Esempio n. 1
0
 /*
  * (non-Javadoc)
  *
  * @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent)
  */
 public void componentMoved(ComponentEvent e) {
   ComponentPosition compPos = this.owner.getComponentPositionAdapter();
   if (compPos.hasWindow()) {
     compPos.setWindowPosition(
         (int) e.getComponent().getLocation().getX(), (int) e.getComponent().getLocation().getY());
   }
 }
 @Override
 public void componentResized(ComponentEvent e) {
   if (owner != null) {
     ComponentPosition compPos = owner.getComponentPositionAdapter();
     if (compPos.hasWindow()
         && e.getComponent().getSize().getWidth() > 10
         && e.getComponent().getSize().getHeight() > 10) {
       compPos.setWindowSize(
           (int) e.getComponent().getSize().getWidth(),
           (int) e.getComponent().getSize().getHeight());
     }
   }
 }
 /*
  * (non-Javadoc)
  *
  * @see org.deegree.igeo.views.IView#init(org.deegree.client.presenter.state.ComponentStateAdapter,
  * org.deegree.client.configuration.ViewForm)
  */
 public void init(ViewFormType viewForm) throws Exception {
   setResizable(
       ((InnerFrameViewFormType) viewForm.get_AbstractViewForm().getValue()).isResizeable());
   setMaximizable(true);
   setIconifiable(true);
   Border outsideBorder = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
   Border insideBorder = BorderFactory.createLineBorder(new Color(197, 197, 220), 3);
   setBorder(BorderFactory.createCompoundBorder(outsideBorder, insideBorder));
   // TODO
   // each internal frame should have its own icon
   setFrameIcon(IconRegistry.getIcon("layers.png"));
   ComponentPosition compPosAdapter = this.owner.getComponentPositionAdapter();
   if (compPosAdapter.hasWindow()) {
     setSize(compPosAdapter.getWindowWidth(), compPosAdapter.getWindowHeight());
     setLocation(compPosAdapter.getWindowLeft(), compPosAdapter.getWindowTop());
   }
   setTitle(this.owner.getName());
   if (getParent() == null) {
     // parent is null view has not been yet added to its parent. This is the case if a
     // module's view is 'closed' when loading a project
     Container con = (Container) owner.getGUIContainer();
     if (con != null) {
       con.add(this);
     }
   }
 }