public static void createToolbar(final StainedSockClient controller, MainFrame mainframe, JToolBar subtoolbar) {
		{
			class ShapeCellRenderer extends JLabel implements ListCellRenderer<ShapeModel> {
				private final Color HIGHLIGHT_COLOR = new Color(255, 0, 0);
				private static final long serialVersionUID = -8418623962015860796L;

				@Override
				public Component getListCellRendererComponent(JList list, ShapeModel shape, int index, boolean isSelected,
						boolean cellHasFocus) {
					setText(controller.getResources().getString(shape.getLangvar()));
					setIcon(shape.getIcon());
					setBorder(new EmptyBorder(2, 2, 2, 2));
					if (isSelected) {
						setForeground(HIGHLIGHT_COLOR);
					} else {
						setForeground(Color.BLACK);
					}
					return this;
				}
			}

			ShapeModel[] shapeModels = {
					new ShapeModel(Shape.Line, "view.subtoolbar.shapetool.line", WorkspaceLine.getIcon()),
					new ShapeModel(Shape.Rectangle, "view.subtoolbar.shapetool.rectangle", WorkspaceRectangle.getIcon()),
					new ShapeModel(Shape.RoundedRectangle, "view.subtoolbar.shapetool.roundedrectangle",
							WorkspaceRoundedRectangle.getIcon()),
					new ShapeModel(Shape.Oval, "view.subtoolbar.shapetool.oval", WorkspaceOval.getIcon()),
					new ShapeModel(Shape.Polygon, "view.subtoolbar.shapetool.polygon", WorkspacePolygon.getIcon()),
					new ShapeModel(Shape.StarPolygon, "view.subtoolbar.shapetool.starpolygon", WorkspaceStarPolygon.getIcon()) };
			JComboBox<ShapeModel> cmbShape = new JComboBox<ShapeModel>(shapeModels);
			cmbShape.setToolTipText(controller.getResources().getString("view.subtoolbar.shapetool.shape"));
			cmbShape.setMaximumSize(new Dimension(200, 20));
			cmbShape.setMinimumSize(new Dimension(200, 20));
			cmbShape.setPreferredSize(new Dimension(200, 20));
			cmbShape.setSize(new Dimension(200, 20));
			cmbShape.setRenderer(new ShapeCellRenderer());
			for (int i = 0; i < cmbShape.getItemCount(); i++) {
				if (cmbShape.getItemAt(i).getShape() == (Shape) Registry.get().get("shapetool_shape").getValue()) {
					cmbShape.setSelectedIndex(i);
					break;
				}
			}
			cmbShape.addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
					Registry.get().put("shapetool_shape",
							new RegistryEntry<Shape>(((ShapeModel) ((JComboBox<ShapeModel>) e.getSource()).getSelectedItem()).getShape()));
				}
			});
			subtoolbar.add(cmbShape);
		}
		subtoolbar.add(Box.createRigidArea(new Dimension(3, 0)));
		switch ((Shape) Registry.get().get("shapetool_shape").getValue()) {
		case Line:
			break;
		case Oval:
			initializeShapeFill(controller, mainframe, subtoolbar);
			break;
		case Polygon: {
			final JSlider sliderPolygonSides = new JSlider();
			final JLabel lblPolygonSides = new JLabel((Integer) Registry.get().get("shapetool_polygon_sides").getValue() + " sides");
			sliderPolygonSides.setBorder(new EmptyBorder(2, 2, 2, 2));
			sliderPolygonSides.setMinimum(3);
			sliderPolygonSides.setMaximum(50);
			sliderPolygonSides.setValue((Integer) Registry.get().get("shapetool_polygon_sides").getValue());
			sliderPolygonSides.setMaximumSize(new Dimension(100, 20));
			sliderPolygonSides.setMinimumSize(new Dimension(100, 20));
			sliderPolygonSides.setPreferredSize(new Dimension(100, 20));
			sliderPolygonSides.setSize(new Dimension(100, 20));
			sliderPolygonSides.setFocusable(false);
			sliderPolygonSides.addChangeListener(new ChangeListener() {
				@Override
				public void stateChanged(ChangeEvent e) {
					lblPolygonSides.setText(sliderPolygonSides.getValue() + " sides");
					Registry.get().put("shapetool_polygon_sides", new RegistryEntry<Integer>(sliderPolygonSides.getValue()));
				}
			});
			subtoolbar.add(sliderPolygonSides);
			subtoolbar.add(lblPolygonSides);
		}
			initializeShapeFill(controller, mainframe, subtoolbar);
			break;
		case Rectangle:
			initializeShapeFill(controller, mainframe, subtoolbar);
			break;
		case RoundedRectangle: {
			final JSlider sliderRoundedPercent = new JSlider();
			final JLabel lblRoundedPercent = new JLabel((int) ((Float) Registry.get().get("shapetool_roundedrectangle_roundedpercent")
					.getValue() * 100)
					+ "% round");
			sliderRoundedPercent.setBorder(new EmptyBorder(2, 2, 2, 2));
			sliderRoundedPercent.setMinimum(1);
			sliderRoundedPercent.setMaximum(100);
			sliderRoundedPercent.setValue((int) ((Float) Registry.get().get("shapetool_roundedrectangle_roundedpercent").getValue() * 100));
			sliderRoundedPercent.setMaximumSize(new Dimension(100, 20));
			sliderRoundedPercent.setMinimumSize(new Dimension(100, 20));
			sliderRoundedPercent.setPreferredSize(new Dimension(100, 20));
			sliderRoundedPercent.setSize(new Dimension(100, 20));
			sliderRoundedPercent.setFocusable(false);
			sliderRoundedPercent.addChangeListener(new ChangeListener() {
				@Override
				public void stateChanged(ChangeEvent e) {
					lblRoundedPercent.setText(sliderRoundedPercent.getValue() + "% round");
					Registry.get().put("shapetool_roundedrectangle_roundedpercent",
							new RegistryEntry<Float>(sliderRoundedPercent.getValue() / 100f));
				}
			});
			subtoolbar.add(sliderRoundedPercent);
			subtoolbar.add(lblRoundedPercent);
		}
			initializeShapeFill(controller, mainframe, subtoolbar);
			break;
		case StarPolygon: {
			final JSlider sliderStarArms = new JSlider();
			final JLabel lblStarArms = new JLabel((Integer) Registry.get().get("shapetool_starpolygon_arms").getValue() + " arms");
			sliderStarArms.setBorder(new EmptyBorder(2, 2, 2, 2));
			sliderStarArms.setMinimum(4);
			sliderStarArms.setMaximum(50);
			sliderStarArms.setValue((Integer) Registry.get().get("shapetool_starpolygon_arms").getValue());
			sliderStarArms.setMaximumSize(new Dimension(100, 20));
			sliderStarArms.setMinimumSize(new Dimension(100, 20));
			sliderStarArms.setPreferredSize(new Dimension(100, 20));
			sliderStarArms.setSize(new Dimension(100, 20));
			sliderStarArms.setFocusable(false);
			sliderStarArms.addChangeListener(new ChangeListener() {
				@Override
				public void stateChanged(ChangeEvent e) {
					lblStarArms.setText(sliderStarArms.getValue() + " arms");
					Registry.get().put("shapetool_starpolygon_arms", new RegistryEntry<Integer>(sliderStarArms.getValue()));
				}
			});
			subtoolbar.add(sliderStarArms);
			subtoolbar.add(lblStarArms);
		}
			initializeShapeFill(controller, mainframe, subtoolbar);
			break;
		}
		subtoolbar.addSeparator();
		{
			final JSlider sliderStrokeSize = new JSlider();
			final JLabel lblStrokeSize = new JLabel((int) (float) (Float) Registry.get().get("shapetool_strokesize").getValue() + " px");
			sliderStrokeSize.setToolTipText(controller.getResources().getString("view.subtoolbar.shapetool.strokesize"));
			sliderStrokeSize.setBorder(new EmptyBorder(2, 2, 2, 2));
			sliderStrokeSize.setMinimum(1);
			sliderStrokeSize.setMaximum(30);
			sliderStrokeSize.setValue((int) (float) (Float) Registry.get().get("shapetool_strokesize").getValue());
			sliderStrokeSize.setMaximumSize(new Dimension(100, 20));
			sliderStrokeSize.setMinimumSize(new Dimension(100, 20));
			sliderStrokeSize.setPreferredSize(new Dimension(100, 20));
			sliderStrokeSize.setSize(new Dimension(100, 20));
			sliderStrokeSize.setFocusable(false);
			sliderStrokeSize.addChangeListener(new ChangeListener() {
				@Override
				public void stateChanged(ChangeEvent e) {
					lblStrokeSize.setText(sliderStrokeSize.getValue() + " px");
					Registry.get().put("shapetool_strokesize", new RegistryEntry<Float>((float) sliderStrokeSize.getValue()));
				}
			});
			subtoolbar.add(sliderStrokeSize);
			subtoolbar.add(lblStrokeSize);
		}
	}