public WorkplacePanel(DocumentFrame parentFrame) {
		this.documentFrame = parentFrame;
		preferences=documentFrame.loadOrganizer.preferences;

		workplace = new JPanel();

		getVerticalScrollBar().setUnitIncrement(preferences.getGuiPixelsPerMeter() / 4);
		getVerticalScrollBar()
				.setBlockIncrement(preferences.getGuiPixelsPerMeter() / 4);
		workplace.setOpaque(true);
		workplace.setLayout(new BoxLayout(workplace, BoxLayout.Y_AXIS));
		workplace.setBorder(new WorkplaceBorder(documentFrame.loadOrganizer));

		workplace.setSize(500, 500);

		workplace.setLayout(null);
		getViewport().add(workplace);

		addMouseMotionListener(new MouseMotionAdapter() {
			@Override
			public void mouseDragged(MouseEvent e) {
				Point origin = getViewport().getViewPosition();
				Point point = e.getPoint();
				point.x += origin.x;
				point.y += origin.y;

				int x = lastClick.x;
				int y = lastClick.y;
				int cx = point.x - lastClick.x;
				int cy = point.y - lastClick.y;

				if (cx < 0) {
					cx = -cx;
					x = x - cx;
				}
				if (cy < 0) {
					cy = -cy;
					y = y - cy;
				}

				selector.setLocation(x, y);
				selector.setSize(cx, cy);

			}
		});

		selector = new JLabel();
		selector.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));

		addPopupMenu();
		
		addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent e) {
				popupGettingInvisible=false;
				Point origin = getViewport().getViewPosition();
				Point point = e.getPoint();
				point.x += origin.x;
				point.y += origin.y;

				lastClick = point;
				if(e.getButton()!=1) return;
				workplace.add(selector);
				selector.setLocation(point);
				selector.setSize(0, 0);
				workplace.setComponentZOrder(selector, 0);
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				if(popupGettingInvisible) {
					popupGettingInvisible=false;
					return;
				}
				if(e.getButton()!=1) return; 
				if (e.isShiftDown() || e.isControlDown()) {
					// nop
				} else {
					// clear selection
					switchSelected(null, true, true);
				}
				for (ContainerComponent c : workplaceComponents) {
					if (c.getBounds().intersects(selector.getBounds())) {
						switchSelected(c, false, true);
					}
				}

				lastClick = null;
				workplace.remove(selector);
				workplace.repaint();
			}

		});

		// add the truck
		truck = new TruckPanel();		
		truck.setSize(parentFrame.documentTruckSize.width * preferences.getGuiPixelsPerMeter()
				/ 1000, parentFrame.documentTruckSize.height
				* preferences.getGuiPixelsPerMeter() / 1000);
		truck.setLocation(preferences.getGuiPixelsPerMeter()/2,
				preferences.getGuiPixelsPerMeter()*1/2); 
		workplace.add(truck);	

		UIManager.put("Slider.paintValue", Boolean.FALSE); //$NON-NLS-1$
		sliderX=new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		sliderX.setSize(truck.getWidth(),sliderX.getPreferredSize().height);
		sliderX.setLocation(truck.getX(),truck.getY()-sliderX.getHeight());
		sliderX.setToolTipText(Messages.getString("WorkplacePanel.1")); //$NON-NLS-1$
		workplace.add(sliderX);

		sliderY=new JSlider(SwingConstants.VERTICAL,0,100,50);
		sliderY.setSize(sliderY.getPreferredSize().width,truck.getHeight());
		sliderY.setLocation(truck.getX()-sliderY.getWidth(),truck.getY());
		sliderY.setToolTipText(Messages.getString("WorkplacePanel.2")); //$NON-NLS-1$
		workplace.add(sliderY);
		sliderX.setOpaque(false);
		
		// do not allow the sliders to be changed by mouse
		sliderX.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				computeInfo();
			}
		});
		sliderX.addKeyListener(new KeyAdapter() {
			@Override
			public void keyReleased(KeyEvent e) {
				computeInfo();
			}
		});		
		sliderY.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				computeInfo();
			}
		});
		sliderY.addKeyListener(new KeyAdapter() {
			@Override
			public void keyReleased(KeyEvent e) {
				computeInfo();
			}
		});		
	}