9.3.1 Designing Panels for Main Screen

 

 

The main screen contains a split pane with Scalar Set Refresh Screen in the left side and Columnar Set Refresh Screen in the right side. In this topic, you will learn to design the Scalar Set Refresh Screen and Columnar Set Refresh Screen. These panels will be integrated in the main screen later.

 

Creating the SaveLoadScreen

 

 

{

    SaveLoadScreen.this.cancelCalled = true;

    SaveLoadScreen.this.setVisible(false);

}

 

 

 

 

 

 

{

if(destFile.getText().trim().equals(""))

  {

    javax.swing.JOptionPane.showMessageDialog(null,"Please Enter the Task File Name","Alert",javax.swing.JOptionPane.ERROR_MESSAGE);

    return;

   }

   if(mode != null && mode.trim().equals("load"))

   {

      java.io.File f = new java.io.File("." + File.separator + "configtasks" +File.separator + "User" + File.separator + destFile.getText() + ".xml");          if(!f.exists())

    {

     javax.swing.JOptionPane.showMessageDialog(null,"Cannot Load informations, The Task file " + f.toString() + " does not exist","Alert",javax.swing.JOptionPane.ERROR_MESSAGE);

     return;

    }  

   }  

    setTaskFile(destFile.getText());

    SaveLoadScreen.this.setVisible(false);

  }

 

 

 

 

Note: If required, you can view the code in the SaveLoadScreen in the sample eBon project.  In the "Project Tree" pane, select "SaveLoadScreen".  Select the "Component" tab. Expand the "Connections" node and double-click on each of the connections to view the code area for the cancel button and the ok button.

 

 

 

 

      public class SaveLoadScreen extends JDialog implements com.adventnet.apiutils.ParameterChangeListener

      {

      //<Begin_Variable_Declarations>

      private boolean initialized = false;

      private java.applet.Applet applet = null;

      ...

      //<End_Variable_Declarations>

 

      boolean cancelCalled = false;

      private String taskFile = null;

      private String mode = null;

      public SaveLoadScreen(String mode) {

      this.mode = mode;

      pack();

      }

      public String getTaskFile() {

      return taskFile;

      }

      public void setTaskFile(String str) {

      taskFile = str;

      }

      ...

 

     

 

Creating the Scalar Set Refresh

DSLAMModule-->org-->dod->internet-->private->enterprises-->adventnet-->switch-->dslamsystem-->dslamCardInfo

 

Property

Value

InstanceName

saveBtn

horizontalAlignment

CENTER

icon

save.png under <Client Builder Home>/images

text

Save

 

 

 

 

     //Begin_SaveConfigurationProfile

      try

      {

      addGroupsToSave(null);

      saveConfigurationInformation();

      }

      catch(java.lang.Exception ex)

      {

      ex.printStackTrace();

      }

      //End_SaveConfigurationProfile

 

 

 

 

 

String taskName = null;

SaveLoadScreen scr = new SaveLoadScreen();

scr.setModal(true);

Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();

scr.setLocation(new Point((dim.width/2-scr.getSize().width/2),(dim.height/2-scr.getSize().height/2 )));

scr.setVisible(true);

if(scr.cancelCalled) {

return;

} else {

taskName = scr.getTaskFile();

}

//Begin_SaveConfigurationProfile

try

{

ConfigCache1.saveConfigInfo("this_group1", "group1", ScalarSetScreen.this, null);

ConfigCache1.SaveIntoXMLAtServer(taskName, true);

addGroupsToSave(null);

saveConfigurationInformation();

}catch(java.lang.Exception ex) {

ex.printStackTrace();

}

//End_SaveConfigurationProfile

 

  

 

Property

Value

InstanceName

loadBtn

horizontalAlignment

CENTER

icon

load.png under <Client Builder Home>/images

text

Load

 

 

 

 

      //Begin_LoadConfigurationProfile

      try

      {

      loadXmlAtServer();

      }

      catch(java.lang.Exception ex)

      {

      ex.printStackTrace();

      }

      //End_LoadConfigurationProfile

 

 

 

 

 

 

String taskName = null;

SaveLoadScreen scr = new SaveLoadScreen();

scr.setModal(true);

Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();

scr.setLocation(new Point((dim.width/2-scr.getSize().width/2),(dim.height/2-scr.getSize().height/2 )));

scr.setVisible(true);

if(scr.cancelCalled)

{

return;

} else{

taskName = scr.getTaskFile();

}

//Begin_LoadConfigurationProfile

try {

ConfigCache1.loadCacheValueFromXMLAtServer(taskName, true);

loadXmlAtServer();

}catch(java.lang.Exception ex) {

ex.printStackTrace();

}

//End_LoadConfigurationProfile

 

 

Creating the Columnar Set Refresh

DSLAMModule-->org-->dod->internet-->private->enterprises-->adventnet-->switch-->dslamsystem-->dslamCardInfo-->cardTable

This completes the Designing Panel for Main Screen.



Copyright © 2009 ZOHO Corp. All Rights Reserved.