Package com.l2client.gui.dialogs

Examples of com.l2client.gui.dialogs.TransparentLoginPanel


    //#############################################################

    SwingUtilities.invokeLater(new Runnable() {

      public void run() {
        final TransparentLoginPanel pan = Singleton.get().getGuiController()
            .displayUserPasswordJPanel();
        // get properties initialized from file or by defaut
        pan.setServer(System.getProperty(UserPropertiesDAO.SERVER_HOST_PROPERTY)+":"+System.getProperty(UserPropertiesDAO.SERVER_PORT_PROPERTY));
        // action that gets executed in the update thread:
        pan.addLoginActionListener(new ActionListener(){
          @Override
          public void actionPerformed(ActionEvent e) {
                // this gets executed in jme thread
                // do 3d system calls in jme thread only!
//                SoundController.getInstance().playOnetime("sound/click.ogg", false, Vector3f.ZERO);

            String[] split = pan.getServer().split(":");

            if(split.length<2) {
              Singleton.get().getGuiController().showErrorDialog("Check your server:port entry");
              return;
            }
            try {
              //store setting in user property for later usage
              System.setProperty(UserPropertiesDAO.SERVER_HOST_PROPERTY,split[0]);
              System.setProperty(UserPropertiesDAO.SERVER_PORT_PROPERTY,split[1]);
              //intentionally not used
              Integer.parseInt(split[1]);
            } catch (NumberFormatException ex) {
              Singleton.get().getGuiController().showErrorDialog("Your port is not a number entry");
              return;
            }
                if ( !initNetwork(pan.getUsername(), pan.getPassword(), pan.getServer()) ) {

                  doLogin();
                  Singleton.get().getGuiController()
                      .showErrorDialog(
                          "Failed to Connect to login server");

                } else {
                  //save port and host to user.home on a successfull login
                  UserPropertiesDAO.saveProperties();
                  Singleton.get().getGuiController().removeAll();
                }
              }
            });
        pan.addCancelActionListener(new ActionListener(){
          @Override
          public void actionPerformed(ActionEvent e) {
            // this gets executed in jme thread
            // do 3d system calls in jme thread only!
//            finished = true;
View Full Code Here


    desktopPane.removeAll();

//    final JInternalFrame internalFrame = new TransparentInternalFrame();
//    internalFrame.setLocation(500, 200);

    final TransparentLoginPanel pan = new TransparentLoginPanel();
//    internalFrame.add(pan);
    //FIXME if pan is used it is the one to be removed on close
    //how do we do dragging of window?
    pan.setTransparency(0.8f);
//    internalFrame.add(pan);
//    internalFrame.setSize(new java.awt.Dimension(200, 140));
//    internalFrame.pack();
//    internalFrame.setVisible(true);
//    desktopPane.add(internalFrame);
   
    //interresting feature too, no borders, just the panel, works too and looks ok without borders
    pan.setLocation(jmeDesktop.getJDesktop().getWidth()/2+50, jmeDesktop.getJDesktop().getHeight()/2-100);

    //commented out, as we have now a check going on if the input is valid
//    //these are the actions for the gui, thy do not define what should be executed on login/cancel
//     // standard swing action:
//    pan.addCancelActionListener(new ActionListener() {
//      public void actionPerformed(ActionEvent e) {
//        // this gets executed in swing thread
//        // alter swing components only in swing thread!
//        pan.setVisible(false);
//        desktopPane.remove(pan);
//      }
//    });
//    pan.addLoginActionListener(new ActionListener() {
//      public void actionPerformed(ActionEvent e) {
//        // this gets executed in swing thread
//        // alter swing components ony in swing thread!
//       
//        pan.setVisible(false);
//        desktopPane.remove(pan);
//      }
//    });
    wireInputSwitch(new ArrayList<BaseUsable>()/*must pass empty otherwise not overriden*/, pan);
    pan.setVisible(true);
    desktopPane.add(pan);
   
    return pan;
  }
View Full Code Here

TOP

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

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.