Exemplo n.º 1
0
  private void init() {
    Dimension miniSize = new Dimension(10, 100);

    releasesPane = new ReleasesPane(this);
    releasesPane.setMinimumSize(miniSize);
    includeInstancesPane = new IncludeInstancesPane(this);
    includeInstancesPane.setMinimumSize(miniSize);
    testResultsPane = new TestResultsPane(this);
    testResultsPane.setMinimumSize(miniSize);

    // Initialize schema
    releasesPane.getController().updateSchemaDisplayPane();

    JLabel titleLabel = new JLabel("ID Generator");
    titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
    titleLabel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    setLayout(new BorderLayout());
    JSplitPane jsp1 =
        new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, releasesPane, includeInstancesPane);
    JSplitPane jsp2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jsp1, testResultsPane);
    jsp1.setResizeWeight(0.6);
    jsp2.setResizeWeight(0.6);
    jsp1.setOneTouchExpandable(true);
    jsp2.setOneTouchExpandable(true);
    add(jsp2, BorderLayout.CENTER);
  }
  public void createJPanel() {
    JSplitPane graphSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    graphSplit.setLeftComponent(previewPanel);
    graphSplit.setRightComponent(dataPanel);
    graphSplit.setOneTouchExpandable(true);
    graphSplit.setDividerLocation(400);

    JPanel graphHolder = new JPanel(new BorderLayout());
    graphHolder.add(graphSplit, BorderLayout.CENTER);
    graphHolder.setBorder(BorderFactory.createTitledBorder(""));

    JPanel tool = new JPanel(new BorderLayout());
    tool.add(saveCSVData, BorderLayout.SOUTH);
    tool.add(aScanType, BorderLayout.CENTER);

    JPanel leftPanel = new JPanel(new BorderLayout());
    leftPanel.add(graphHolder, BorderLayout.CENTER);
    leftPanel.add(tool, BorderLayout.SOUTH);

    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    split.setOneTouchExpandable(true);
    split.setRightComponent(imageViewPanel);
    split.setLeftComponent(leftPanel);
    split.setDividerLocation(600);

    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(split, BorderLayout.CENTER);

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(mainPanel);

    aScanType.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            imageViewPanel.setViewType(aScanType.getSelectedIndex());
          }
        });
    saveCSVData.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            try {
              File f = FileSelectionField.getUserFile();
              f = FileOperations.renameFileType(f, "csv");
              saveAScanData(f);
            } catch (Exception e1) {
              JOptionPane.showMessageDialog(
                  null,
                  "Error : " + e1.getLocalizedMessage(),
                  "Error Saving Data",
                  JOptionPane.ERROR_MESSAGE);
              e1.printStackTrace();
            }
          }
        });
  }
Exemplo n.º 3
0
  /** Prepares a new <code>MainPanel</code> object. */
  public MainPanel() {
    super(new BorderLayout());
    // TODO: not new Host() but null
    final TerminalPanel terminalPanel = new TerminalPanel(new Host());
    final JSplitPane splitPane =
        new JSplitPane(JSplitPane.VERTICAL_SPLIT, new ClustersPanel(), terminalPanel);
    Tools.getGUIData().setTerminalSplitPane(splitPane);

    splitPane.setContinuousLayout(true);
    splitPane.setResizeWeight(1);
    splitPane.setOneTouchExpandable(true);

    splitPane.addHierarchyListener(
        new HierarchyListener() {
          public void hierarchyChanged(final HierarchyEvent e) {
            mExpanding.lock();
            if (!expandingDone && (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {

              expandingDone = true;
              mExpanding.unlock();
              Tools.getGUIData().expandTerminalSplitPane(1);
            } else {
              mExpanding.unlock();
            }
          }
        });
    add(splitPane, BorderLayout.CENTER);
  }
 /**
  * Method which creates the basic split pane. Subclasses may override this method.
  *
  * @param view DrawingView for which the JSplitPane should be created
  * @return the created JSplitPane
  */
 protected JSplitPane createSplitPane(DrawingView view) {
   JSplitPane dividedContents =
       new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, getLeftComponent(), getRightComponent());
   dividedContents.setAlignmentX(JSplitPane.LEFT_ALIGNMENT);
   dividedContents.setOneTouchExpandable(true);
   return dividedContents;
 }
Exemplo n.º 5
0
    public HttpClientFrame() {
      client = new HttpClient(new MultiThreadedHttpConnectionManager());
      client.getHttpConnectionManager().getParams().setConnectionTimeout(30000);

      JPanel panInput = new JPanel(new FlowLayout());

      String[] aURLs = {
        "http://www.apache.org/",
        "http://www.google.com/",
        "http://www.opensource.org/",
        "http://www.anybrowser.org/",
        "http://jakarta.apache.org/",
        "http://www.w3.org/"
      };

      final JButton btnGET = new JButton("GET");
      btnGET.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
              String url = (String) cmbURL.getSelectedItem();
              if (url != null && url.length() > 0) {
                loadPage(url);
              }
            }
          });

      cmbURL = new JComboBox(aURLs);
      cmbURL.setToolTipText("Enter a URL");
      cmbURL.setEditable(true);
      cmbURL.setSelectedIndex(0);

      JLabel lblURL = new JLabel("URL:");

      panInput.add(lblURL);
      panInput.add(cmbURL);
      panInput.add(btnGET);

      taTextResponse = new JTextArea();
      taTextResponse.setEditable(false);
      taTextResponse.setCaretPosition(0);

      htmlPane = new JEditorPane();
      htmlPane.setContentType("text/html");
      htmlPane.setEditable(false);

      JSplitPane splitResponsePane =
          new JSplitPane(
              JSplitPane.HORIZONTAL_SPLIT,
              new JScrollPane(taTextResponse),
              new JScrollPane(htmlPane));
      splitResponsePane.setOneTouchExpandable(false);
      splitResponsePane.setDividerLocation(350);
      // it would be better to set resizeWeight, but this method does
      // not exist in JRE 1.2.2
      //            splitResponsePane.setResizeWeight(0.5);

      this.getContentPane().setLayout(new BorderLayout());
      this.getContentPane().add(panInput, BorderLayout.NORTH);
      this.getContentPane().add(splitResponsePane, BorderLayout.CENTER);
    }
  public ConstraintsGUI() {
    this.rtTop = new RuleTree(null, false, false); // the Rules
    this.rtTop.addParserGUIListener(this);
    this.rtBottom = new RuleTree(null, true, false); // the Atomics
    this.rtBottom.addParserGUIListener(this);

    JSplitPane treePane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    treePane.setOneTouchExpandable(true);
    treePane.setContinuousLayout(true);
    JScrollPane tmpPane = new JScrollPane(this.rtTop.getTree());
    tmpPane.setSize(170, 210);
    tmpPane.setPreferredSize(new Dimension(170, 210));
    treePane.setTopComponent(tmpPane);
    tmpPane = new JScrollPane(this.rtBottom.getTree());
    tmpPane.setSize(170, 210);
    tmpPane.setPreferredSize(new Dimension(170, 210));
    treePane.setBottomComponent(tmpPane);
    treePane.getTopComponent().setSize(185, 300);
    treePane.getBottomComponent().setSize(185, 300);
    treePane.resetToPreferredSizes();

    this.right = new RuleConstraint(null);

    this.mainPane = new JSplitPane();
    this.mainPane.setOneTouchExpandable(true);
    this.mainPane.setContinuousLayout(true);
    this.mainPane.setRightComponent(this.right.getComponent());
    this.mainPane.setLeftComponent(treePane);

    setGrammar(null);
    setLayout(null);
  }
Exemplo n.º 7
0
  public SplitPaneDemo2() {
    super("SplitPaneDemo2");

    // Create an instance of SplitPaneDemo
    SplitPaneDemo splitPaneDemo = new SplitPaneDemo();
    JSplitPane top = splitPaneDemo.getSplitPane();
    splitPaneDemo.getImageList().addListSelectionListener(this);

    // XXXX: Bug #4131528, borders on nested split panes accumulate.
    // Workaround: Set the border on any split pane within
    // another split pane to null. Components within nested split
    // panes need to have their own border for this to work well.
    top.setBorder(null);

    // Create a regular old label
    label = new JLabel("Click on an image name in the list.", JLabel.CENTER);

    // Create a split pane and put "top" (a split pane)
    // and JLabel instance in it.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, top, label);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(180);

    // Provide minimum sizes for the two components in the split pane
    top.setMinimumSize(new Dimension(100, 50));
    label.setMinimumSize(new Dimension(100, 30));

    // Add the split pane to this frame
    getContentPane().add(splitPane);
  }
  /** Arg Constructor */
  public TicTacToeFrame() {

    // Creates a panel for grid layout
    // http://www.java-tips.org/java-se-tips-100019/15-javax-swing/1751-how-to-make-split-pane-using-swing8.html
    JPanel gameBoardPanel = new JPanel(new GridLayout(3, 3, 0, 0)); // panel 1
    JPanel gameStatusPanel = new JPanel(); // panel 2

    // JLabel gameStatusLabel = new JLabel("Area 2");
    // gameBoardPanel.add(j1);
    gameStatusPanel.add(gameStatusLabel2);
    gameStatusPanel.add(gameStatusLabel3);
    gameStatusPanel.add(gameStatusLabel);
    JSplitPane splitPane =
        new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, gameBoardPanel, gameStatusPanel);
    splitPane.setResizeWeight(0.9);
    splitPane.setOneTouchExpandable(true);
    getContentPane().add(splitPane);

    // Adds 9 cells to grid layout
    for (int i = 0; i < 3; i++) {
      for (int k = 0; k < 3; k++) {
        gameBoardPanel.add(cells[i][k] = new Cell());
      }
    }
  }
Exemplo n.º 9
0
 public static JSplitPane createSplitPane(
     int splitOrientation, Component comp1, Component comp2, int divider) {
   JSplitPane js = new JSplitPane(splitOrientation, comp1, comp2);
   js.setOneTouchExpandable(true);
   js.setDividerLocation(divider);
   return js;
 }
Exemplo n.º 10
0
  public SplitPaneDemo() {

    // Create the list of images and put it in a scroll pane.

    list = new JList(imageNames);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    list.setSelectedIndex(0);
    list.addListSelectionListener(this);

    JScrollPane listScrollPane = new JScrollPane(list);
    picture = new JLabel();
    picture.setFont(picture.getFont().deriveFont(Font.ITALIC));
    picture.setHorizontalAlignment(JLabel.CENTER);

    JScrollPane pictureScrollPane = new JScrollPane(picture);

    // Create a split pane with the two scroll panes in it.
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listScrollPane, pictureScrollPane);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(150);

    // Provide minimum sizes for the two components in the split pane.
    Dimension minimumSize = new Dimension(100, 50);
    listScrollPane.setMinimumSize(minimumSize);
    pictureScrollPane.setMinimumSize(minimumSize);

    // Provide a preferred size for the split pane.
    splitPane.setPreferredSize(new Dimension(400, 200));
    updateLabel(imageNames[list.getSelectedIndex()]);
  }
Exemplo n.º 11
0
  private void initGUI() {

    this.setTitle("Notizen");
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.lp, this.np);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(200);

    // Provide minimum sizes for the two components in the split pane
    Dimension minimumSize = new Dimension(200, 100);
    this.lp.setMinimumSize(minimumSize);
    this.np.setMinimumSize(minimumSize);

    this.setLayout(new BorderLayout());

    this.addWindowListener(this.c);

    this.setSize(700, 400);
    this.setLocationRelativeTo(null);

    this.add(splitPane, BorderLayout.CENTER);

    this.setVisible(true);
  }
Exemplo n.º 12
0
 private JSplitPane createMessageLedgerSplitter(JScrollPane ledger, RvDetailsPanel details) {
   final JSplitPane splitter = new JSplitPane(JSplitPane.VERTICAL_SPLIT, ledger, details);
   splitter.setOneTouchExpandable(true);
   splitter.setDividerLocation(0.5);
   splitter.setBorder(BorderFactory.createEmptyBorder());
   return splitter;
 }
Exemplo n.º 13
0
 /**
  * Constructs an OSPControl.
  *
  * @param _model
  */
 public OSPControl(Object _model) {
   super(ControlsRes.getString("OSPControl.Default_Title")); // $NON-NLS-1$
   model = _model;
   if (model != null) {
     // added by D Brown 2006-09-10
     // modified by D Brown 2007-10-17
     if (OSPRuntime.translator != null) OSPRuntime.translator.associate(this, model.getClass());
     String name = model.getClass().getName();
     setTitle(
         name.substring(1 + name.lastIndexOf("."))
             + ControlsRes.getString("OSPControl.Controller")); // $NON-NLS-1$ //$NON-NLS-2$
   }
   ToolsRes.addPropertyChangeListener("locale", this);
   Font labelFont = new Font("Dialog", Font.BOLD, 12); // $NON-NLS-1$
   inputLabel =
       new JLabel(
           ControlsRes.getString("OSPControl.Input_Parameters"),
           SwingConstants.CENTER); // $NON-NLS-1$
   inputLabel.setFont(labelFont);
   messageTextArea = new JTextArea(5, 5);
   JScrollPane messageScrollPane = new JScrollPane(messageTextArea);
   // contains a view of the control
   JPanel topPanel = new JPanel(new BorderLayout());
   topPanel.add(inputLabel, BorderLayout.NORTH);
   topPanel.add(controlScrollPane, BorderLayout.CENTER);
   buttonPanel.setVisible(true);
   topPanel.add(buttonPanel, BorderLayout.SOUTH); // buttons are added using addButton method.
   // clear panel acts like a button to clear the message area
   JPanel clearPanel = new JPanel(new BorderLayout());
   clearPanel.addMouseListener(new ClearMouseAdapter());
   clearLabel = new JLabel(ControlsRes.getString("OSPControl.Clear")); // $NON-NLS-1$
   clearLabel.setFont(new Font(clearLabel.getFont().getFamily(), Font.PLAIN, 9));
   clearLabel.setForeground(Color.black);
   clearPanel.add(clearLabel, BorderLayout.WEST);
   // contains the messages
   JPanel bottomPanel = new JPanel(new BorderLayout());
   messageLabel =
       new JLabel(
           ControlsRes.getString("OSPControl.Messages"), SwingConstants.CENTER); // $NON-NLS-1$
   messageLabel.setFont(labelFont);
   bottomPanel.add(messageLabel, BorderLayout.NORTH);
   bottomPanel.add(messageScrollPane, BorderLayout.CENTER);
   bottomPanel.add(clearPanel, BorderLayout.SOUTH);
   Container cp = getContentPane();
   splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topPanel, bottomPanel);
   splitPane.setOneTouchExpandable(true);
   cp.add(splitPane, BorderLayout.CENTER);
   messageTextArea.setEditable(false);
   controlScrollPane.setPreferredSize(new Dimension(350, 200));
   controlScrollPane.setMinimumSize(new Dimension(0, 50));
   messageScrollPane.setPreferredSize(new Dimension(350, 75));
   if (OSPRuntime.translator != null && model != null) {
     OSPRuntime.translator.associate(table, model.getClass());
   }
   Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
   setLocation(
       (d.width - getSize().width) / 2, (d.height - getSize().height) / 2); // center the frame
   init();
 }
 /** Sets the Splitter attribute of the JMiddlegenFrame object */
 public void setSplitter() {
   int fheight = this.getHeight();
   int sheight = Toolkit.getDefaultToolkit().getScreenSize().height;
   if (fheight >= sheight) {
     _split.setDividerLocation(sheight - 480);
   }
   _split.setOneTouchExpandable(true);
 }
Exemplo n.º 15
0
  /**
   * Layout the GUI components for this RootFolder with an expandable JTree on the left of a
   * SplitPane and the main panel on the right.
   */
  private void layoutWithFolderTree() {

    // get the JTree Component
    tree = getFolderTree();

    if (rootIsVisible == false) // hide the root node
    {
      tree.setRootVisible(false);
    }

    // Enable tool tips.
    ToolTipManager.sharedInstance().registerComponent(tree);

    // embed the JTree in a scrollpane
    JScrollPane treeScrollPane = new JScrollPane(tree);

    // the left and right sides of the JSplitPane
    JComponent leftside, rightside = mainPanel;

    if (globalParams == null && buttonPanel == null) {
      // Create a split pane with the treePane on the left and the main panel on the right
      leftside = treeScrollPane;
    } else {
      /* the left side has global parameters and/or buttons so we need to create a
       * vertical split pane for the tree and the parameters/buttons
       */
      JComponent globalParamsBox = globalParams;

      // globalparams could be null but buttonpanel could not be
      if (buttonPanel != null) {
        // add buttonPanel to a vertical box with globalParams
        Box box = Box.createVerticalBox();

        if (globalParams != null) {
          box.add(globalParams);
          box.add(Box.createVerticalGlue());
        }
        box.add(buttonPanel);

        globalParamsBox = box;
      }

      // create the vertical split pane
      leftside =
          new JSplitPane(
              JSplitPane.VERTICAL_SPLIT, treeScrollPane, new JScrollPane(globalParamsBox));
    }

    // create the horizontal split pane with the left and right sides
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftside, rightside);
    splitPane.setOneTouchExpandable(true);

    // set the divider location to be 150 pixels from the left
    splitPane.setDividerLocation(150);

    // add the split pane to this component
    add(splitPane, BorderLayout.CENTER);
  }
Exemplo n.º 16
0
  public BIDE(String configDir) {
    super(new BorderLayout());

    this.configDir = configDir;
    configFile = "config.xml";
    BXML xml = new BXML(configDir + configFile, false);
    root = xml.getRoot();
    logHandle = new BLogHandle();
    logHandle.config(log);

    // Create an application list
    develop = new HashMap<BElement, BDevelop>();
    mainPanel = new JPanel(new BorderLayout());
    treePanel = new JPanel(new BorderLayout());

    // Create a tree that allows one selection at a time.
    top = new BTreeNode(root, "APP");
    for (BElement el : root.getElements()) top.add(new BTreeNode(el, el.getValue()));

    treemodel = new DefaultTreeModel(top);
    tree = new BImageTree("/org/baraza/resources/leftpanel.jpg", treemodel, true);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setCellRenderer(new BCellRenderer());
    tree.addTreeSelectionListener(this);
    treeScroll = new JScrollPane(tree);
    treePanel.add(treeScroll, BorderLayout.CENTER);

    String menuStrs[] = {
      "New Project",
      "Close Project",
      "Delete Project",
      "Save Projects",
      "Encrypt File",
      "Open Applications",
      "About"
    };
    JMenuBar menuBar = new JMenuBar();
    JMenu fileMenu = new JMenu("File");
    JMenuItem menuItem = null;
    for (String menuStr : menuStrs) {
      menuItem = new JMenuItem(menuStr);
      menuItem.addActionListener(this);
      fileMenu.add(menuItem);
    }
    menuBar.add(fileMenu);
    super.add(menuBar, BorderLayout.PAGE_START);

    desktop = new BImageDesktop("/org/baraza/resources/background.jpg");
    mainPanel.add(desktop, BorderLayout.CENTER);
    mainPanel.add(logHandle.getStatusBar(), BorderLayout.PAGE_END);

    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treePanel, mainPanel);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(150);

    super.add(splitPane, BorderLayout.CENTER);
    log.info("Status : Running");
  }
Exemplo n.º 17
0
 private JSplitPane createSubjectExplorerSplitter(
     JScrollPane subjectExplorer, JSplitPane messageLedger) {
   final JSplitPane splitter =
       new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, subjectExplorer, messageLedger);
   splitter.setOneTouchExpandable(false);
   splitter.setDividerLocation(0.25);
   splitter.setBorder(BorderFactory.createEmptyBorder());
   return splitter;
 }
Exemplo n.º 18
0
 /**
  * Constructs the tab for monitors and uploads.
  *
  * @param MONITOR_VIEW the <tt>MonitorView</tt> instance containing all component for the monitor
  *     display and handling
  * @param UPLOAD_MEDIATOR the <tt>UploadMediator</tt> instance containing all component for the
  *     monitor display and handling
  */
 public MonitorUploadTab(final MonitorView MONITOR_VIEW, final ComponentMediator UPLOAD_MEDIATOR) {
   super(I18n.tr("Monitor"), I18n.tr("View Searches and Uploads"), "monitor_tab");
   SPLIT_PANE =
       new JSplitPane(JSplitPane.VERTICAL_SPLIT, MONITOR_VIEW, UPLOAD_MEDIATOR.getComponent());
   SPLIT_PANE.setContinuousLayout(true);
   SPLIT_PANE.setOneTouchExpandable(true);
   DividerLocationSettingUpdater.install(
       SPLIT_PANE, UISettings.UI_MONITOR_UPLOAD_TAB_DIVIDER_LOCATION);
 }
Exemplo n.º 19
0
 private JSplitPane createConnectionListSplitter(
     JScrollPane connectionList, JSplitPane subjectExplorerSplitter) {
   final JSplitPane splitter =
       new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, connectionList, subjectExplorerSplitter);
   splitter.setOneTouchExpandable(false);
   splitter.setDividerLocation(0.20);
   splitter.setBorder(BorderFactory.createEmptyBorder());
   return splitter;
 }
Exemplo n.º 20
0
 /**
  * This method initializes splitPanePrincipal
  *
  * @return javax.swing.JSplitPane
  */
 private JSplitPane getSplitPanePrincipal() {
   if (splitPanePrincipal == null) {
     splitPanePrincipal = new JSplitPane();
     splitPanePrincipal.setContinuousLayout(true);
     splitPanePrincipal.setDividerLocation(150);
     splitPanePrincipal.setOneTouchExpandable(true);
     splitPanePrincipal.setRightComponent(getSplitPane());
     splitPanePrincipal.setLeftComponent(getPanelJogadores());
   }
   return splitPanePrincipal;
 }
Exemplo n.º 21
0
  /** Initializes the frame components. */
  private void initialize() {
    GridBagConstraints c;

    // Set title, size and menus
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setTitle("Mibble MIB Browser");
    Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
    Rectangle bounds = new Rectangle();
    bounds.width = (int) (size.width * 0.75);
    bounds.height = (int) (size.height * 0.75);
    bounds.x = (size.width - bounds.width) / 2;
    bounds.y = (size.height - bounds.height) / 2;
    setBounds(bounds);
    setMenuBar(menuBar);
    initializeMenu();
    getContentPane().setLayout(new GridBagLayout());

    // Add horizontal split pane
    JSplitPane horizontalSplitPane = new JSplitPane();
    horizontalSplitPane.setDividerLocation((int) (bounds.width * 0.35));
    c = new GridBagConstraints();
    c.weightx = 1.0d;
    c.weighty = 1.0d;
    c.fill = GridBagConstraints.BOTH;
    getContentPane().add(horizontalSplitPane, c);

    // Add status label
    c = new GridBagConstraints();
    c.gridy = 1;
    c.fill = GridBagConstraints.BOTH;
    c.insets = new Insets(2, 5, 2, 5);
    getContentPane().add(statusLabel, c);

    // Add MIB tree
    mibTree = MibTreeBuilder.getInstance().getTree();
    mibTree.addTreeSelectionListener(
        new TreeSelectionListener() {
          public void valueChanged(TreeSelectionEvent e) {
            updateTreeSelection();
          }
        });
    horizontalSplitPane.setLeftComponent(new JScrollPane(mibTree));

    // Add description area & SNMP panel
    JSplitPane verticalSplitPane = new JSplitPane();
    verticalSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    verticalSplitPane.setDividerLocation((int) (bounds.height * 0.40));
    verticalSplitPane.setOneTouchExpandable(true);
    descriptionArea.setEditable(false);
    verticalSplitPane.setLeftComponent(new JScrollPane(descriptionArea));
    snmpPanel = new SnmpPanel(this);
    verticalSplitPane.setRightComponent(snmpPanel);
    horizontalSplitPane.setRightComponent(verticalSplitPane);
  }
Exemplo n.º 22
0
  /** Initializes the contents of the frame and loads components */
  @SuppressWarnings("serial")
  private void initialize() {
    // Load configuration file if exists, otherwise crates empty
    // configuration file
    logger.debug("Loading settings");
    Settings.getInstance().loadSettings();

    // main window of the GUI
    frmBqtTestParser =
        new JFrame() {
          @Override
          public void dispose() {
            if (bqtPanel.couldDispose()) {
              super.dispose();
            }
          }
        };
    frmBqtTestParser.setTitle("BQT Test Parser");
    frmBqtTestParser.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    // Container for panels with test results and settings
    tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    //		tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);

    JTextPane log = GUIAppender.getTextPane("ALL_GUI");
    JScrollPane logpane = Utils.getScrollPane(log);

    JSplitPane splitpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, tabbedPane, logpane);
    splitpane.setOneTouchExpandable(true);
    splitpane.setDividerSize(15);

    splitpane.setResizeWeight(0.9);

    frmBqtTestParser.getContentPane().add(splitpane);

    PanelDetails details = new PanelDetails(results);
    PanelResults totalResults = new PanelResults(results, details);
    bqtPanel = new BQTRunnerPanel();
    JenkinsPanel jenkinsPanel = new JenkinsPanel();
    JScrollPane settingsPane = Utils.getScrollPane(new SettingsPanel());

    tabbedPane.addTab("Total Results", null, totalResults.getPanel(), null);
    tabbedPane.addTab("Results Details", null, details.getPanel(), null);
    tabbedPane.addTab("BQT Runner", null, bqtPanel, null);
    tabbedPane.addTab("Jenkins", null, jenkinsPanel, null);
    tabbedPane.addTab("Settings", null, settingsPane, null);
    //		tabbedPane.setSelectedIndex(3);
    totalResults.initialize();
    details.initialize();
    frmBqtTestParser.pack();
    frmBqtTestParser.setLocationRelativeTo(null);
    logger.info("Application has been initialized.");
  }
Exemplo n.º 23
0
 /**
  * This method initializes splitPane
  *
  * @return javax.swing.JSplitPane
  */
 private JSplitPane getSplitPane() {
   if (splitPane == null) {
     splitPane = new JSplitPane();
     splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
     splitPane.setPreferredSize(new Dimension(300, 118));
     splitPane.setDividerLocation(100);
     splitPane.setBottomComponent(getPanelResultados());
     splitPane.setTopComponent(getScrollPane());
     splitPane.setOneTouchExpandable(true);
   }
   return splitPane;
 }
Exemplo n.º 24
0
  private void layoutComponents() {
    super.setLayout(new BorderLayout(0, 0));

    JSplitPane mainSplitPane = new JSplitPane();
    mainSplitPane.setResizeWeight(1.0);
    mainSplitPane.setOneTouchExpandable(true);

    layoutLeftPart(mainSplitPane);
    layoutRightPart(mainSplitPane);

    super.add(mainSplitPane);
  }
Exemplo n.º 25
0
  public ProblemPanel(Module module, final WorkDescription workDescription) {
    problemViewer = module.createProblemViewer();
    problemLoader = module.createProblemLoader();

    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(createTopComponent(module, workDescription));
    splitPane.setBottomComponent(createBottomComponent());
    splitPane.setOneTouchExpandable(true);
    splitPane.setResizeWeight(0.5);
    splitPane.setDividerLocation(getHeight() / 2);

    setLayout(new BorderLayout());
    add(splitPane, BorderLayout.CENTER);
  }
Exemplo n.º 26
0
  private void initialize() {

    UtilidadesAvisosPanels.inicializarIdiomaAvisosPanels();

    this.setLayout(new GridBagLayout());

    jSplitPane = new JSplitPane();

    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Búsquedas", IconLoader.icon("actuaciones.png"), new SearchListPanel());

    //		jSplitPane.setLeftComponent(new SearchListPanel());
    jSplitPane.setLeftComponent(tabbedPane);
    jSplitPane.setRightComponent(new PrintEditorPanel());
    jSplitPane.setEnabled(true);
    //		jSplitPane.setOneTouchExpandable(true);
    jSplitPane.setResizeWeight(0);
    //
    //		jSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
    //				getAvisosListPanel(),getJPanelGraphicEditor());
    //
    jSplitPane.setOneTouchExpandable(true);
    jSplitPane.setDividerSize(10);

    this.add(
        jSplitPane,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            1,
            1,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));

    ((PrintEditorPanel) getJPanelGraphicEditor().getGeopistaEditorPanel())
        .addActionListener(
            new java.awt.event.ActionListener() {
              public void actionPerformed(ActionEvent e) {
                mapaJPanel_actionPerformed();
              }
            });

    this.setVisible(true);
  }
Exemplo n.º 27
0
  /** Create a new control center window. */
  public ControlCenterWindow(ControlCenter main) {
    this.controlcenter = main;
    this.consoleheights = new HashMap();

    getContentPane().setLayout(new BorderLayout());
    clayout = new CardLayout();
    content = new JPanel(clayout);

    this.console = new ConsolePanel();
    console.setConsoleEnabled(false);
    this.sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    sp.setOneTouchExpandable(true);
    sp.setDividerLocation(200);
    content.setMinimumSize(new Dimension(0, 0));
    console.setMinimumSize(new Dimension(0, 0));
    sp.add(content);
    sp.add(console);
    getContentPane().add("Center", sp);
    sp.setResizeWeight(1.0);

    statusbar = new StatusBar();
    getContentPane().add("South", statusbar);

    this.filechooser = new JFileChooser(".");
    filechooser.setFileFilter(
        new FileFilter() {
          public boolean accept(File f) {
            return f.isDirectory() || f.getName().toLowerCase().endsWith(".jccproject.xml");
          }

          public String getDescription() {
            return "Jadex Project Files";
          }
        });

    // BasicSplitPaneDivider.OneTouchActionHandler

    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            console.close();
            if (controlcenter.exit()) {
              dispose();
              setVisible(false);
            }
          }
        });
  }
Exemplo n.º 28
0
 /**
  * Helper method for {@link LookAndFeel#installProperty(JComponent, String, Object)}.
  *
  * @param propertyName the name of the property
  * @param value the value of the property
  * @throws IllegalArgumentException if the specified property cannot be set by this method
  * @throws ClassCastException if the property value does not match the property type
  * @throws NullPointerException if <code>c</code> or <code>propertyValue</code> is <code>null
  *     </code>
  */
 void setUIProperty(String propertyName, Object value) {
   if (propertyName.equals("dividerSize")) {
     if (!clientDividerSizeSet) {
       setDividerSize(((Integer) value).intValue());
       clientDividerSizeSet = false;
     }
   } else if (propertyName.equals("oneTouchExpandable")) {
     if (!clientOneTouchExpandableSet) {
       setOneTouchExpandable(((Boolean) value).booleanValue());
       clientOneTouchExpandableSet = false;
     }
   } else {
     super.setUIProperty(propertyName, value);
   }
 }
  /**
   * Die Methode wird vom Konstruktor aufgerufen und stellt die spezifizierte Vorauswahl durch die
   * Komponente <code>PreselectionTree</code> und die konkrete Auswahl durch die Komponente <code>
   * PreselectionLists</code> dar.
   *
   * @see PreselectionTree
   * @see PreselectionLists
   */
  private void createAndShowGui() {
    setLayout(new BorderLayout());

    _preselectionTree.addPreselectionListener(_preselectionLists);

    // teilt Tree und Lists voneinander mittels SplitPane
    final JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splitPane.setContinuousLayout(true);
    splitPane.setOneTouchExpandable(true);
    splitPane.setLeftComponent(_preselectionTree);
    splitPane.setRightComponent(_preselectionLists);
    splitPane.setResizeWeight(0.25);

    add(splitPane, BorderLayout.CENTER);
  }
Exemplo n.º 30
0
 public PlanViewPanel(MealSuggestionListModel listModel) {
   setLayout(new BorderLayout());
   MealOrganizerPanel lst = new MealOrganizerPanel();
   detailsPanel = new DetailedRecipeVisualizationPanel(lst);
   // add(new DetailedRecipeVisualizationPanel(lst), BorderLayout.NORTH);
   // add(new JScrollPane(lst), BorderLayout.CENTER);
   JSplitPane splitPane =
       new JSplitPane(
           JSplitPane.VERTICAL_SPLIT,
           true,
           detailsPanel,
           new JScrollPane(
               lst,
               ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER,
               ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
   splitPane.setOneTouchExpandable(true);
   add(splitPane);
 }