Package javax.swing

Examples of javax.swing.JInternalFrame$FocusPropertyChangeListener


    return jmb==null?count:count+1;
  }

  @Override
  public int getIndexOfChild(Component child) {
    JInternalFrame jif = (JInternalFrame) getWidget();
    JMenuBar jmb = jif.getJMenuBar();
    if (jmb == null)
      return getContentAdapter().getIndexOfChild(child);
    else if (child == jmb)
      return 0;
    else
View Full Code Here


    else
      return getContentAdapter().getIndexOfChild(child) + 1;
  }
  @Override
  protected Component newWidget() {
    return new JInternalFrame();
  }
View Full Code Here

  }

  @Override
  public void addChildByConstraints(Component child, Object constraints) {
    if(child instanceof JMenuBar){
      JInternalFrame jif = (JInternalFrame) getWidget();
      jif.setJMenuBar((JMenuBar)child);
    }else
      getContentAdapter().addChildByConstraints(child, constraints);
  }
View Full Code Here

  public Component cloneWidget() {
    JDesktopPane copy = (JDesktopPane) super.cloneWidget();
    JDesktopPane pane = (JDesktopPane) getWidget();
    for (JInternalFrame frame : pane.getAllFrames()) {
      WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(frame);
      JInternalFrame copy_frame = (JInternalFrame) adapter.cloneWidget();
      copy.add(copy_frame);
      copy_frame.setVisible(true);
    }
    return copy;
  }
View Full Code Here

    return i == 0;
  }

  @Override
  public void showChild(Component widget) {
    JInternalFrame jif = (JInternalFrame) widget;
    jif.toFront();
  }
View Full Code Here

    return new JDesktopPane();
  }

  @Override
  public void addChildByConstraints(Component child, Object constraints) {
    JInternalFrame jif = (JInternalFrame)child;
    JDesktopPane jtp = (JDesktopPane) getWidget();
    jif.setBounds((Rectangle)constraints);
    jtp.add(jif);
    jif.setVisible(true);
    clearAllSelected();
    WidgetAdapter.getWidgetAdapter(child).setSelected(true);
    getWidget().validate();
    jif.toFront();
  }
View Full Code Here

      Graphics2D g2d = (Graphics2D) clipg;
      g2d.setStroke(STROKE);
      g2d.setColor(RED_COLOR);
      Rectangle bounds;
      if (inDesktop){
        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        Component rootPane = jif.getRootPane();
        bounds = SwingUtilities.getLocalBounds(rootPane);
        bounds = SwingUtilities.convertRectangle(rootPane, bounds, jif);
      }else{
        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        JMenuBar jmenuBar = jif.getJMenuBar();
        bounds = SwingUtilities.getLocalBounds(jmenuBar);
        bounds = SwingUtilities.convertRectangle(jmenuBar, bounds, adaptable.getWidget());
      }
      g2d.drawRect(bounds.x, bounds.y, bounds.width, 22);
    } else if (dropStatus == DROPPING_PERMITTED) {
      Graphics2D g2d = (Graphics2D) clipg;
      g2d.setStroke(STROKE);
      g2d.setColor(GREEN_COLOR);
      Rectangle bounds;
      if (inDesktop){
        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        Component rootPane = jif.getRootPane();
        bounds = SwingUtilities.getLocalBounds(rootPane);
        bounds = SwingUtilities.convertRectangle(rootPane, bounds, jif);
      }else{
        bounds = SwingUtilities.getLocalBounds(adaptable.getContentPane());
        bounds = SwingUtilities.convertRectangle(adaptable.getContentPane(), bounds, adaptable.getWidget());
View Full Code Here

      return super.drop(p);
    if (!isForbid()) {
      JDesktopPane jtp = (JDesktopPane) adaptable.getWidget();
      adaptable.clearAllSelected();     
      for (WidgetAdapter drop : adaptable.getDropWidget()) {
        JInternalFrame jif = (JInternalFrame) drop.getWidget();
        Point htsp = drop.getHotspotPoint();
        int state = adaptable.getState();
        switch (state) {
        case Azimuth.STATE_BEAN_HOVER:
          jif.setLocation(p.x - htsp.x, p.y - htsp.y);
          break;
        default:
          Point pt = adaptable.getMascotLocation();
          jif.setLocation(pt.x - htsp.x, pt.y - htsp.y);
          break;
        }
        jtp.add(jif);
        drop.requestNewName();
        jif.setVisible(true);
        drop.setSelected(true);
        drop.setDirty(true);
        jif.toFront();       
      }
      adaptable.getWidget().validate();
      return true;
    } else {
      Toolkit.getDefaultToolkit().beep();
View Full Code Here

      adaptable.setMascotLocation(p);
      setDropStatus(JInternalFramePainter.DROPPING_PERMITTED);
      return true;
    } else{
      if(hasMenuBar()){
        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        JRootPane rootPane = jif.getRootPane();
        p=SwingUtilities.convertPoint(rootPane, p, adaptable.getContentPane());
      }
      return getContentOperation().dragOver(p);
    }
  }
View Full Code Here

      adaptable.setMascotLocation(p);
      setDropStatus(JInternalFramePainter.DROPPING_PERMITTED);
      return true;
    } else{
      if(hasMenuBar()){
        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        JRootPane rootPane = jif.getRootPane();
        p=SwingUtilities.convertPoint(rootPane, p, adaptable.getContentPane());
      }
      return getContentOperation().dragEnter(p);
    }
  }
View Full Code Here

TOP

Related Classes of javax.swing.JInternalFrame$FocusPropertyChangeListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.