com.jidesoft.swing.JideSplitPane Java Examples

The following examples show how to use com.jidesoft.swing.JideSplitPane. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AOIMonitoringToolView.java    From snap-desktop with GNU General Public License v3.0 6 votes vote down vote up
private JPanel createCentrePanel() {
    final JideSplitPane splitPane1V = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT);

    aoiTable = new JTable();
    aoiTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    aoiTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    aoiTable.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(final MouseEvent e) {
            final int clickCount = e.getClickCount();
            if (clickCount == 2) {
                performOpenAction();
            } else if (clickCount == 1) {
                performSelectAction();
            }
        }
    });
    splitPane1V.add(new JScrollPane(aoiTable));

    worldMapUI = new WorldMapUI();
    splitPane1V.add(worldMapUI.getWorlMapPane());

    return splitPane1V;
}
 
Example #2
Source File: JideSplitPaneDemo.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
private static JideSplitPane createSplitPane() {
    JTree tree = new JTree();
    JTable table = new JTable(new DefaultTableModel(10, 3));
    JList list = new JList(new Object[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", }) {
        /**
         * 
         */
        private static final long serialVersionUID = 1L;

        public Dimension getPreferredScrollableViewportSize() {
            Dimension size = super.getPreferredScrollableViewportSize();
            size.width = 100;
            return size;
        }
    };

    _jideSplitPane = new JideSplitPane(JideSplitPane.HORIZONTAL_SPLIT);
    _jideSplitPane.setProportionalLayout(true);
    _jideSplitPane.add(new JScrollPane(tree), JideBoxLayout.FLEXIBLE);
    _jideSplitPane.add(new JScrollPane(table), JideBoxLayout.VARY);
    _jideSplitPane.add(new JScrollPane(list), JideBoxLayout.FLEXIBLE);
    return _jideSplitPane;
}
 
Example #3
Source File: JideSplitPaneElementTest.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
@Test
public void select() {
    final JideSplitPane splitPaneNode = (JideSplitPane) ComponentUtils.findComponent(JideSplitPane.class, frame);
    final JSONArray initialValue = new JSONArray(splitPaneNode.getDividerLocations());
    driver = new JavaAgent();
    final IJavaElement splitPane = driver.findElementByCssSelector("jide-split-pane");
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            splitPane.marathon_select("[129]");
        }
    });
    new Wait("Waiting for split pane to set divider location") {
        @Override
        public boolean until() {
            return initialValue.getInt(0) != new JSONArray(splitPaneNode.getDividerLocations()).getInt(0);
        }
    };
    JSONArray pa = new JSONArray(splitPaneNode.getDividerLocations());
    AssertJUnit.assertEquals(129, pa.getInt(0));
}
 
Example #4
Source File: JideSplitPaneElementTest.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
@Test
public void select2() {
    final JideSplitPane splitPaneNode = (JideSplitPane) ComponentUtils.findComponent(JideSplitPane.class, frame);
    final JSONArray initialValue = new JSONArray(splitPaneNode.getDividerLocations());
    driver = new JavaAgent();
    final IJavaElement splitPane = driver.findElementByCssSelector("jide-split-pane");
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            splitPane.marathon_select("[238,450]");
        }
    });
    new Wait("Waiting for split pane to set divider location") {
        @Override
        public boolean until() {
            return initialValue.getInt(1) != new JSONArray(splitPaneNode.getDividerLocations()).getInt(1);
        }
    };
    JSONArray pa = new JSONArray(splitPaneNode.getDividerLocations());
    AssertJUnit.assertEquals(450, pa.getInt(1));
}
 
Example #5
Source File: CDataNodeComponent.java    From binnavi with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new data node component.
 * 
 * @param module Module whose data is shown in the component.
 * @param originContainer
 */
public CDataNodeComponent(final INaviModule module, final IViewContainer originContainer) {
  super(new BorderLayout());

  Preconditions.checkNotNull(module, "IE01960: Module argument can not be null");

  final JideSplitPane splitPane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT);

  splitPane.setDoubleBuffered(true);
  splitPane.setOneTouchExpandable(true);
  splitPane.setMinimumSize(new Dimension(0, 0));
  splitPane.setProportionalLayout(true);
  splitPane.setInitiallyEven(true);

  final JPanel panel = new JPanel(new BorderLayout());
  dataSectionComponent = new DataSectionComponent(module, originContainer);
  panel.add(dataSectionComponent);

  final JTabbedPane pane = new JTabbedPane();
  pane.addTab("Navigation", new CNavigationPanel(dataSectionComponent.getHexView()));

  splitPane.addPane(panel);
  splitPane.addPane(pane);
  add(splitPane);
}
 
Example #6
Source File: RJideSplitPaneTest.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
@Test
public void getText() {
    final int location = 250;
    final JideSplitPane splitpane = (JideSplitPane) ComponentUtils.findComponent(JideSplitPane.class, frame);
    LoggingRecorder lr = new LoggingRecorder();
    final RJideSplitPaneElement rSplitPane = new RJideSplitPaneElement(splitpane, null, null, lr);
    final List<String> text = new ArrayList<String>();
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            splitpane.setDividerLocation(0, location);
            rSplitPane.mouseReleased(null);
            text.add(rSplitPane.getAttribute("text"));
        }
    });
    new Wait("Waiting for Jide Splitpane text.") {
        @Override
        public boolean until() {
            return text.size() > 0;
        }
    };
    AssertJUnit.assertTrue(text.get(0).matches("\\[" + location + "\\,.*"));
}
 
Example #7
Source File: RJideSplitPaneElement.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
protected void mouseReleased(MouseEvent me) {
    JideSplitPane sp = (JideSplitPane) getComponent();
    String currentDividerLoctions = new JSONArray(sp.getDividerLocations()).toString();
    if (!currentDividerLoctions.equals(prevLocations)) {
        recorder.recordSelect(this, currentDividerLoctions);
    }
}
 
Example #8
Source File: BinningConfigurationPanel.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
private JComponent createAggregatorsAndVariablesPanel() {
    JideSplitPane splitPane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT);
    splitPane.add(createAggregatorsPanel());
    splitPane.add(createVariablesPanel());
    splitPane.setShowGripper(true);
    splitPane.setProportionalLayout(true);
    splitPane.setProportions(new double[]{0.6});
    return splitPane;
}
 
Example #9
Source File: CCombinedMemoryPanel.java    From binnavi with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new combined memory panel object.
 *
 * @param parent Parent window of the panel.
 * @param debugPerspectiveModel Describes the active debugger GUI options.
 */
public CCombinedMemoryPanel(
    final JFrame parent, final CDebugPerspectiveModel debugPerspectiveModel) {
  super(new BorderLayout());

  Preconditions.checkNotNull(parent, "IE01361: Parent argument can not be null");
  m_debugPerspectiveModel = Preconditions.checkNotNull(
      debugPerspectiveModel, "IE01362: Debug perspective model argument can not be null");

  m_debugPerspectiveModel.addListener(m_internalListener);

  final JideSplitPane pane = new JideSplitPane(JideSplitPane.HORIZONTAL_SPLIT) {
    private static final long serialVersionUID = -1326165812499630343L;

    // ESCA-JAVA0025: Workaround for Case 1168
    @Override
    public void updateUI() {
      // Workaround for Case 1168: The mere presence of a JIDE component
      // screws up the look and feel.
    }
  };

  pane.setDividerSize(3); // ATTENTION: Part of the Case 1168 workaround
  pane.setProportionalLayout(true);

  final CMemoryRefreshButtonPanel refreshPanel = new CMemoryRefreshButtonPanel(
      parent, debugPerspectiveModel, new InternalRangeProvider(),
      new InternalStackRangeProvider());

  m_memorySelectionPanel = new CMemorySelectionPanel(parent, debugPerspectiveModel, refreshPanel);

  // Create the GUI
  pane.addPane(m_memorySelectionPanel);

  m_stackPanel = new CStackView(debugPerspectiveModel);
  pane.addPane(m_stackPanel);

  add(pane);
}
 
Example #10
Source File: RJideSplitPaneTest.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Test
public void selectSplitPane() {
    JideSplitPane splitpane = (JideSplitPane) ComponentUtils.findComponent(JideSplitPane.class, frame);
    LoggingRecorder lr = new LoggingRecorder();
    RJideSplitPaneElement rfxSplitPane = new RJideSplitPaneElement(splitpane, null, null, lr);
    splitpane.setDividerLocation(0, 250);
    rfxSplitPane.mouseReleased(null);

    Call call = lr.getCall();
    AssertJUnit.assertEquals("select", call.getFunction());
    AssertJUnit.assertEquals(250, new JSONArray((String) call.getState()).getInt(0));
}
 
Example #11
Source File: JideSplitPaneElement.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
public boolean marathon_select(String value) {
    JideSplitPane splitPane = (JideSplitPane) getComponent();
    JSONArray locations = new JSONArray(value);
    int[] dividerLocations = new int[locations.length()];
    for (int i = 0; i < locations.length(); i++) {
        dividerLocations[i] = locations.getInt(i);
    }
    splitPane.setDividerLocations(dividerLocations);
    return true;
}
 
Example #12
Source File: JideSplitPaneElementTest.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Test
public void getText() throws Throwable {
    JideSplitPane splitPaneNode = (JideSplitPane) ComponentUtils.findComponent(JideSplitPane.class, frame);
    String expected = new JSONArray(splitPaneNode.getDividerLocations()).toString();
    driver = new JavaAgent();
    IJavaElement splitPane = driver.findElementByCssSelector("jide-split-pane");
    String actual = splitPane.getText();
    AssertJUnit.assertEquals(expected, actual);
}
 
Example #13
Source File: RJideSplitPaneElement.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
@Override
public String _getText() {
    JideSplitPane sp = (JideSplitPane) getComponent();
    return new JSONArray(sp.getDividerLocations()).toString();
}
 
Example #14
Source File: RJideSplitPaneElement.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
@Override
protected void mouseButton1Pressed(MouseEvent me) {
    JideSplitPane sp = (JideSplitPane) getComponent();
    prevLocations = new JSONArray(sp.getDividerLocations()).toString();
}
 
Example #15
Source File: CGraphPanel.java    From binnavi with Apache License 2.0 4 votes vote down vote up
/**
 * Sets up all the splitters and other minor GUI elements of the graph panel.
 */
private void createGui() {
  m_graphSplitter = new JideSplitPane() {
    private static final long serialVersionUID = -4363828908016863289L;

    // ESCA-JAVA0025: Workaround for Case 1168
    @Override
    public void updateUI() {
      // Workaround for Case 1168: The mere presence of a JIDE component
      // screws up the look and feel.
    }
  };

  m_graphSplitter.setOrientation(JideSplitPane.VERTICAL_SPLIT);

  m_graphSplitter.addPane(m_centerPanel);
  m_graphSplitter.addPane(m_bottomPanel);

  m_graphTaggingSplitter = new JideSplitPane() {
    private static final long serialVersionUID = -9037540212052390552L;

    // ESCA-JAVA0025: Workaround for Case 1168
    @Override
    public void updateUI() {
      // Workaround for Case 1168: The mere presence of a JIDE component
      // screws up the look and feel.
    }
  };

  m_graphTaggingSplitter.setOrientation(JideSplitPane.HORIZONTAL_SPLIT);
  m_graphTaggingSplitter.addPane(m_leftPanel);
  m_graphTaggingSplitter.addPane(m_graphSplitter);
  m_graphTaggingSplitter.addPane(m_rightPanel);

  m_graphTaggingSplitter.setDoubleBuffered(true);
  m_graphTaggingSplitter.setOneTouchExpandable(true);
  m_graphTaggingSplitter.setMinimumSize(new Dimension(0, 0));

  m_graphSplitter.setDoubleBuffered(true);
  m_graphSplitter.setOneTouchExpandable(true);
  m_graphSplitter.setMinimumSize(new Dimension(0, 0));

  add(m_graphTaggingSplitter);

  add(m_toolBar, BorderLayout.NORTH);
}
 
Example #16
Source File: JideSplitPaneDemo.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public JideSplitPaneDemo() {
    JideSplitPane splitPane = createSplitPane();
    add(splitPane);
}
 
Example #17
Source File: JideSplitPaneElement.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
@Override
public String _getText() {
    JideSplitPane splitpane = (JideSplitPane) getComponent();
    return new JSONArray(splitpane.getDividerLocations()).toString();
}