Package javax.swing

Examples of javax.swing.JDesktopPane$ComponentPosition


      drawBounds(frame);
      setBoundsForFrame(frame, dragBounds.x, dragBounds.y, dragBounds.width, dragBounds.height);
    }

    protected void drawBounds(JComponent frame) {
      JDesktopPane desktop = getDesktopPane(frame);
      Graphics graphics = desktop.getGraphics();
      graphics.setXORMode(Color.WHITE);
      if (dragBounds.width == 0 || dragBounds.height == 0) {
        graphics.drawLine(dragBounds.x, dragBounds.y, dragBounds.x + dragBounds.width, dragBounds.y + dragBounds.height);
      } else {
        graphics.drawRect(dragBounds.x, dragBounds.y, dragBounds.width, dragBounds.height);
View Full Code Here


    public void setBoundsForFrame(JComponent frame, int newX, int newY, int newWidth, int newHeight) {
      if (newWidth == frame.getWidth() && newHeight == frame.getHeight()) {
        moveFrame(frame, newX + newWidth / 2, newY + newHeight / 2);
      } else {
        JDesktopPane parent = getDesktopPane(frame);
        DockLayout layout = (DockLayout)parent.getLayout();
        if (newX == 0 && newY == 0 && newWidth == parent.getWidth() && newHeight == parent.getHeight()) {
          layout.maximizeLayoutComponent(frame);
        } else {
          layout.minimizeLayoutComponent(frame);
          layout.resizeLayoutComponent(frame, newX, newY, newWidth, newHeight);
        }
View Full Code Here

    setJMenuBar(menuBar);
    }
   
    private void buildContent() {
        desktop = new JDesktopPane();
        getContentPane().add(desktop);
    }
View Full Code Here

        final AnimControl conn = n.getControl(AnimControl.class);
        SwingUtilities.invokeLater(new Runnable() {

          public void run() {
            final JDesktopPane desktopPane = jmeDesktop.getJDesktop();
            final JInternalFrame internalFrame = new JInternalFrame();

            internalFrame.setLocation(20, 20);
            internalFrame.setResizable(false);
            internalFrame.setFrameIcon(null);
            AnimationSwitchSideBar bar = new AnimationSwitchSideBar();
            bar.setTarget(conn, getAnimations());
            internalFrame.add(bar);
           
            internalFrame.setVisible(true);
            internalFrame.setSize(new java.awt.Dimension(200, 180));
            internalFrame.pack();

            desktopPane.add(internalFrame);
          }
        });      
     
      }
    }
View Full Code Here

        return help;
    }

    protected void buildContent() {
        desktop = new JDesktopPane();
        getContentPane().add(desktop);
    }
View Full Code Here

   */
  public TextReport(View view, String TitleBar, String helpfilein, String frameName) {

    this.view = view;
    this.frameName = frameName;
    JDesktopPane desktopin = null;
    desktop = desktopin;

    helpfile = helpfilein;
    newline = System.getProperty("line.separator");
    //the above didnt work!!!!
View Full Code Here

        Container contentPane = awtWindow;
        awtWindow.setUndecorated( true );
        dontDrawBackground( contentPane );
//            ( (JComponent) contentPane ).setOpaque( false );

        desktop = new JDesktopPane() {
            private static final long serialVersionUID = 1L;
            public void paint( Graphics g ) {
                if ( !isShowingJFrame() ) {
                    g.clearRect( 0, 0, getWidth(), getHeight() );
                }
View Full Code Here

    jmeDragAndDrop = new JMEDragAndDrop(jmeDesktop);
  }
 
  //TODO save and store slot actions
  public ShortCutPanel displayShortCutPanel(){
    final JDesktopPane desktopPane = jmeDesktop.getJDesktop();
    final JInternalFrame internalFrame = new TransparentInternalFrame();
    final ShortCutPanel pan = new ShortCutPanel();

    ActionButton[] arr = new ActionButton[10];
    arr[0]=new DnDSlotAction(jmeDesktop, ActionManager.getInstance().getAction(2));
    arr[1]=new DnDSlotAction(jmeDesktop, ActionManager.getInstance().getAction(10002));
    arr[2]=new DnDSlotAction(jmeDesktop, ActionManager.getInstance().getAction(5));
    for(int i=3;i<10;i++){
      arr[i]=new DnDSlotAction(jmeDesktop, null);
    }
   
    pan.setSlots(arr);
    pan.validate();
   
    internalFrame.add(pan);
    internalFrame.setVisible(true);
    internalFrame.pack();
    internalFrame.setLocation(desktopPane.getWidth()-internalFrame.getWidth(),desktopPane.getHeight()-internalFrame.getHeight());

    desktopPane.add(internalFrame);
   
    ArrayList<BaseUsable> acts = new ArrayList<BaseUsable>();
    acts.add(ActionManager.getInstance().getAction(2));
    acts.add(ActionManager.getInstance().getAction(10002));
    acts.add(ActionManager.getInstance().getAction(5));
    wireInputSwitch(acts, pan);
   
    desktopPane.repaint();
    desktopPane.revalidate();
    return pan;
  }
View Full Code Here

   * Creates a Shortcut panel consisting of 10 slots
   * @param map  Actions to be placed in the slots, can be null for empty slots
   * @return      the final panel
   */
  public ShortCutPanel displayShortCutPanel(HashMap<Integer, BaseUsable> map){
    final JDesktopPane desktopPane = jmeDesktop.getJDesktop();
    final JInternalFrame internalFrame = new TransparentInternalFrame();
    final ShortCutPanel pan = new ShortCutPanel();

    ActionButton[] arr = new ActionButton[10];
    ArrayList<BaseUsable> used = new ArrayList<BaseUsable>();
    for(int i=0;i<arr.length;i++){
      BaseUsable b = map.get(i);
      arr[i]=new DnDSlotAction(jmeDesktop, b/*yes, can be null (empty slot)*/);
      if(b != null)//these one not null only used ones
        used.add(b);
    }
   
    pan.setSlots(arr);
    pan.validate();
   
    internalFrame.add(pan);
    internalFrame.setVisible(true);
    internalFrame.pack();
    internalFrame.setLocation(desktopPane.getWidth()-internalFrame.getWidth(),desktopPane.getHeight()-internalFrame.getHeight());

    desktopPane.add(internalFrame);
   
    wireInputSwitch(used, pan);
   
    desktopPane.repaint();
    desktopPane.revalidate();
    return pan;
  }
View Full Code Here

    desktopPane.revalidate();
    return pan;
  }
 
  public SkillAndActionsJPanel displaySkillAndActionsPanel(final HashMap<Integer, BaseUsable> map){
    final JDesktopPane desktopPane = jmeDesktop.getJDesktop();
    final JInternalFrame internalFrame = new TransparentInternalFrame();
    final SkillAndActionsJPanel pan = new SkillAndActionsJPanel();

    pan.validate();
    pan.addUsable(map.values().toArray(new BaseUsable[0]), jmeDesktop);
    internalFrame.add(pan);
    internalFrame.setVisible(true);
    internalFrame.pack();
    internalFrame.setLocation(desktopPane.getWidth()
        - internalFrame.getWidth(), 20);

    ArrayList<BaseUsable> acts = new ArrayList<BaseUsable>();
    acts.add(new SkillAndActionsPanelToggel(-10, "SkillAndActionsPanelToggel") {
      @Override
      public void onAction(String name, boolean isPressed, float tpf) {
        //only on release
        if (!isPressed) {
        if (internalFrame.isVisible()) {
          internalFrame.setVisible(false);
          desktopPane.remove(internalFrame);
          desktopPane.repaint();
          desktopPane.revalidate();
        } else {
          internalFrame.setVisible(true);
          desktopPane.add(internalFrame);
          desktopPane.repaint();
          desktopPane.revalidate();
        }
        }
      }
    });
    Singleton.get().getInputController().addInput(acts);
View Full Code Here

TOP

Related Classes of javax.swing.JDesktopPane$ComponentPosition

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.