Package com.l2client.gui.dialogs

Examples of com.l2client.gui.dialogs.SkillAndActionsJPanel


  }
 
  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);

    wireInputSwitch(acts, pan);
    MoveByBackgroundListener mover = new MoveByBackgroundListener(pan, internalFrame);
    pan.addMouseListener(mover);
    pan.addMouseMotionListener(mover);
   
    internalFrame.setVisible(false);

    return pan;
  }
View Full Code Here


 
 
  public SkillAndActionsJPanel displaySkillAndActionsPanel(){
    final JDesktopPane desktopPane = jmeDesktop.getJDesktop();
    final JInternalFrame internalFrame = new TransparentInternalFrame();
    final SkillAndActionsJPanel pan = new SkillAndActionsJPanel();

    pan.validate();
    pan.addUsable(ActionManager.getInstance().getActions(), 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);

    wireInputSwitch(acts, pan);
    MoveByBackgroundListener mover = new MoveByBackgroundListener(pan, internalFrame);
    pan.addMouseListener(mover);
    pan.addMouseMotionListener(mover);
   
    internalFrame.setVisible(false);

    return pan;
  }
View Full Code Here

TOP

Related Classes of com.l2client.gui.dialogs.SkillAndActionsJPanel

Copyright © 2015 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.