public ContainerComponent(WorkplacePanel parent, Container container) {
		this.container=container;
		this.workplacePanel=parent;
		preferences=workplacePanel.documentFrame.loadOrganizer.preferences;
		
		
		setBorder(BorderFactory.createLineBorder(Color.BLACK,1));
		Dimension boxSize=container.getSize();
		
		Dimension size=new Dimension(boxSize.width*preferences.getGuiPixelsPerMeter()/1000,boxSize.height*preferences.getGuiPixelsPerMeter()/1000);
		setSize(size);
		setPreferredSize(new Dimension(size));
		
		setOpaque(true);

		setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
		

		final ContainerComponent component=this;
		
		addMouseMotionListener(new MouseMotionAdapter() {

			@Override
			public void mouseDragged(MouseEvent e) {
				Point point=e.getPoint();
				Point location=getLocation();
				int x=location.x+point.x-lastClick.x;
				int y=location.y+point.y-lastClick.y;
				//check borders of other components
				workplacePanel.moveSelectedComponents(component, x, y);				
				workplacePanel.checkScrollBounds();
			}
		});
		addMouseListener(new MouseAdapter() {
		    @Override
			public void mousePressed(MouseEvent e) {
		    		workplacePanel.workplace.setComponentZOrder(component,0);
		    		if(selected==false) {
			    		if(e.isControlDown() || e.isShiftDown()) {
			    			workplacePanel.switchSelected(component,false,true);
			    		} else {
			    			workplacePanel.switchSelected(component,true,true);
			    		}
		    		}
		    		lastClick=e.getPoint();
		    }
		    @Override
			public void mouseReleased(MouseEvent e) {
	    			workplacePanel.computeInfo();
		    }		    
		});
		
		addKeyListener(new KeyAdapter() {
			@Override
			public void keyPressed(KeyEvent e) {
				int offset=1;
				Rectangle r=getBounds();
				boolean recompute=false;
				
				if(e.getKeyCode()==KeyEvent.VK_UP) {
					workplacePanel.moveSelectedComponents(component,r.x,r.y-offset);
					recompute=true;
				} else
				if(e.getKeyCode()==KeyEvent.VK_DOWN) {
					workplacePanel.moveSelectedComponents(component,r.x,r.y+offset);
					recompute=true;
				} else
				if(e.getKeyCode()==KeyEvent.VK_LEFT) {
					workplacePanel.moveSelectedComponents(component,r.x-offset,r.y);
					recompute=true;
				} else
				if(e.getKeyCode()==KeyEvent.VK_RIGHT) {
					workplacePanel.moveSelectedComponents(component,r.x+offset,r.y);
					recompute=true;
				} else						
				if(e.getKeyCode()==KeyEvent.VK_DELETE) {
						workplacePanel.deleteSelected();
				}
				if(recompute) {
					workplacePanel.computeInfo();
				}
			}
		});
		
		setText("<html><table align=center valign=center><tr><td align=center><b>"+container.getName()+"</b><br><font size=1>"+container.getSap()+" "+container.getSize().width+"&nbsp;x&nbsp;"+container.getSize().height+" "+container.getWeight()+"kg</font></td></tr></table></html>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
		setFont(new Font("verdana",Font.PLAIN,9)); //$NON-NLS-1$
		setHorizontalAlignment(SwingConstants.CENTER);
		setVerticalAlignment(SwingConstants.CENTER);
		addPopupMenu();
		
		hiddenLabel=	new JLabel();
		hiddenLabel.updateUI();
		hiddenLabel.setBackground(this.getBackground());
		hiddenLabel.setSize(getHeight(), getWidth());
		hiddenLabel.setFont(this.getFont());
		hiddenLabel.setBorder(this.getBorder());
		hiddenLabel.setOpaque(true);
		hiddenLabel.setHorizontalAlignment(this.getHorizontalAlignment());
		hiddenLabel.setVerticalAlignment(this.getVerticalAlignment());
		hiddenLabel.setVerticalTextPosition(this.getVerticalTextPosition());
		hiddenLabel.setHorizontalAlignment(this.getHorizontalTextPosition());
		hiddenLabel.setPreferredSize(this.getPreferredSize());
		hiddenLabel.setText(this.getText());
	}