Package org.jpedal.examples.simpleviewer.gui

Examples of org.jpedal.examples.simpleviewer.gui.CheckNode


       
        if(i<nodes.getLength()){
          String name = nodes.item(i).getNodeName();
          if(!name.startsWith("#")){
            //Node to add
            CheckNode newLeaf = new CheckNode(Messages.getMessage("PdfCustomGui."+name));
            newLeaf.setEnabled(true);
            //Set to reversedMessage for saving of preferences
            reverseMessage.put(Messages.getMessage("PdfCustomGui."+name), name);
            String propValue = properties.getValue(name);
            //Set if should be selected
            if(propValue.length()>0 && propValue.equals("true")){
              newLeaf.setSelected(true);
            }else{
              newLeaf.setSelected(false);
            }
           
            //If has child nodes
            if(nodes.item(i).hasChildNodes()){
              //Store this top value
View Full Code Here


              if(scrollComponents[k] instanceof JViewport){
                Component[] viewportComponents = ((JViewport)scrollComponents[k]).getComponents();
                for(int l=0; l!=viewportComponents.length; l++){
                  if(viewportComponents[l] instanceof JTree){
                    JTree tree = ((JTree)viewportComponents[l]);
                    CheckNode root = (CheckNode)tree.getModel().getRoot();
                    if(root.getChildCount()>0){
                      saveMenuPreferencesChildren(root, gui);
                    }
                  }
                }
              }
View Full Code Here

    }
  }

  private void saveMenuPreferencesChildren(CheckNode root, SwingGUI gui){
    for(int i=0; i!=root.getChildCount(); i++){
      CheckNode node = (CheckNode)root.getChildAt(i);
      String value = ((String)reverseMessage.get(node.getText()));
      if(node.isSelected()){
        properties.setValue(value, "true");
        gui.alterProperty(value, true);
      }else{
        properties.setValue(value, "false");
        gui.alterProperty(value, false);
      }

      if(node.getChildCount()>0){
        saveMenuPreferencesChildren(node, gui);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.jpedal.examples.simpleviewer.gui.CheckNode

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.