Java Code Examples for javax.swing.JSplitPane#HORIZONTAL_SPLIT

The following examples show how to use javax.swing.JSplitPane#HORIZONTAL_SPLIT . 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: MainPanel.java    From openvisualtraceroute with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Init the component
 */
private void init() {
	if (!Env.INSTANCE.isOpenGLAvailable()) {
		LOGGER.warn("No graphic card that supports required OpenGL features has been detected. The 3D map will be not be available");
	}
	ToolTipManager.sharedInstance().setInitialDelay(0);
	// init panels
	_statusPanel = new StatusPanel(_services);
	_replayPanel = new ReplayPanel(_services, _statusPanel);
	_controlPanel = new ControlPanel(_services, this, _replayPanel, Env.INSTANCE.isIs3dMap(), Env.INSTANCE.getMode());

	_split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	_rightSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
	_rightPanel = new JPanel(new BorderLayout());
	_rightPanel.add(_rightSplit, BorderLayout.CENTER);
	_rightPanel.add(_statusPanel, BorderLayout.SOUTH);
	_split.setRightComponent(_rightPanel);
	createRightView();
	createMap(false);
	add(_split, BorderLayout.CENTER);

	// add header
	add(_controlPanel, BorderLayout.NORTH);
	resizeSplit();
}
 
Example 2
Source File: FourierPanel.java    From osp with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Creates the GUI.
 */
protected void createGUI() {
	fourierManager = new DatasetManager();
	fourierManager.setXPointsLinked(true);
  table = new DataTable();
  table.add(fourierManager);
  plot = new PlottingPanel("", "", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  plotPanel = new JPanel(new BorderLayout());
  plotPanel.add(plot, BorderLayout.CENTER);
  splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  splitPane.setResizeWeight(1);
  JScrollPane scroller = new JScrollPane(table);
  splitPane.setRightComponent(scroller);
  splitPane.setLeftComponent(plotPanel);
  add(splitPane, BorderLayout.CENTER);
}
 
Example 3
Source File: MotifSplitPaneDivider.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * overrides to hardcode the size of the divider
 * PENDING(jeff) - rewrite JSplitPane so that this ins't needed
 */
public void setDividerSize(int newSize) {
    Insets          insets = getInsets();
    int             borderSize = 0;
    if (getBasicSplitPaneUI().getOrientation() ==
        JSplitPane.HORIZONTAL_SPLIT) {
        if (insets != null) {
            borderSize = insets.left + insets.right;
        }
    }
    else if (insets != null) {
        borderSize = insets.top + insets.bottom;
    }
    if (newSize < pad + minimumThumbSize + borderSize) {
        setDividerSize(pad + minimumThumbSize + borderSize);
    } else {
        vThumbHeight = hThumbWidth = newSize - pad - borderSize;
        super.setDividerSize(newSize);
    }
}
 
Example 4
Source File: JExtendedSplitPane.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void computeDividerLocationWhenHidden(Component hiddenComponent) {
    if (getTopComponent().isVisible() || getBottomComponent().isVisible()) {
        if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
            if (hiddenComponent == getFirstComponent()) {
                dividerLocation = hiddenComponent.getSize().width / (getSize().getWidth() - dividerSize);
            } else {
                dividerLocation = (getSize().getWidth() - dividerSize - hiddenComponent.getSize().width) / (getSize()
                                                                                                                .getWidth()
                                                                                                           - dividerSize);
            }
        } else {
            if (hiddenComponent == getFirstComponent()) {
                dividerLocation = hiddenComponent.getSize().height / (getSize().getHeight() - dividerSize);
            } else {
                dividerLocation = (getSize().getHeight() - dividerSize - hiddenComponent.getSize().height) / (getSize()
                                                                                                                  .getHeight()
                                                                                                             - dividerSize);
            }
        }
        dividerLocation = Math.max(0, dividerLocation);
        dividerLocation = Math.min(1, dividerLocation);
    }
}
 
Example 5
Source File: ClassesControllerUI.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void initComponents() {
    setLayout(new BorderLayout());

    final JPanel staticFieldsBrowserPanel = classesController.getStaticFieldsBrowserController().getPanel();
    staticFieldsBrowserPanel.setPreferredSize(new Dimension(250, 500));
    staticFieldsBrowserPanel.setVisible(false);

    contentsSplit = new JExtendedSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                                           classesController.getClassesListController().getPanel(), staticFieldsBrowserPanel);
    contentsSplit.setResizeWeight(1d);

    final JPanel legendPanel = new LegendPanel(false);
    legendPanel.setVisible(false);

    tweakSplitPaneUI(contentsSplit);

    add(contentsSplit, BorderLayout.CENTER);
    add(legendPanel, BorderLayout.SOUTH);

    staticFieldsBrowserPanel.addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(HierarchyEvent e) {
                if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                    legendPanel.setVisible(staticFieldsBrowserPanel.isShowing());
                }
            }
        });
}
 
Example 6
Source File: CDebugEventListPanel.java    From binnavi with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new debug event list panel where debug events are displayed.
 *
 * @param eventListManager Provides the event lists that are displayed in this panel.
 */
public CDebugEventListPanel(final ITraceListProvider eventListManager) {
  super(new BorderLayout());

  Preconditions.checkNotNull(
      eventListManager, "IE01369: Event list manager argument can't be null");

  // Create the table that shows the recorded event lists.
  m_tracesTable = new CEventListTable(eventListManager);

  // Add a selection listener that updates the right table
  // if the selection in the left table changes.
  m_tracesTable.getSelectionModel().addListSelectionListener(new InternalSelectionListener());

  final JPanel rightPanel = new JPanel(new BorderLayout());

  m_traceEventTable = new CEventTable(new CEventTableModel());
  m_traceEventTable.getSelectionModel()
      .addListSelectionListener(new InternalEventSelectionListener());

  final CTablePanel<ITraceEvent> filteredPanel = new CTraceEventsPanel(m_traceEventTable);

  m_eventValueTable = new CEventValueTable(m_eventModel);
  m_eventValueTable.addMouseListener(new InternalMouseListener());

  final JSplitPane splitPane1 = new JSplitPane(
      JSplitPane.HORIZONTAL_SPLIT, true, filteredPanel, new JScrollPane(m_eventValueTable));
  rightPanel.add(splitPane1, BorderLayout.CENTER);
  splitPane1.setResizeWeight(0.5);

  m_tracesPanel = new CTracesPanel(m_tracesTable);

  final JSplitPane splitPane =
      new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, m_tracesPanel, rightPanel);
  add(splitPane, BorderLayout.CENTER);
  splitPane.setResizeWeight(0.5);
}
 
Example 7
Source File: FeatureOverviewWindow.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
private JSplitPane addTicPlot(PeakListRow row) {
  JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  // labels for TIC visualizer
  Map<Feature, String> labelsMap = new HashMap<Feature, String>(0);

  // scan selection
  ScanSelection scanSelection = new ScanSelection(rawFiles[0].getDataRTRange(1), 1);

  // mz range
  Range<Double> mzRange = null;
  mzRange = feature.getRawDataPointsMZRange();
  // optimize output by extending the range
  double upper = mzRange.upperEndpoint();
  double lower = mzRange.lowerEndpoint();
  double fiveppm = (upper * 5E-6);
  mzRange = Range.closed(lower - fiveppm, upper + fiveppm);

  // labels
  labelsMap.put(feature, feature.toString());

  TICVisualizerWindow window = new TICVisualizerWindow(rawFiles, // raw
      TICPlotType.BASEPEAK, // plot type
      scanSelection, // scan selection
      mzRange, // mz range
      row.getPeaks(), // selected features
      labelsMap); // labels

  pane.add(window.getTICPlot());
  pane.add(window.getToolBar());
  pane.setResizeWeight(1);
  pane.setDividerSize(1);
  pane.setBorder(BorderFactory.createLineBorder(Color.black));
  return pane;
}
 
Example 8
Source File: Test6910490.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init() {
    Insets insets = new Insets(10, 10, 10, 10);
    Dimension size = new Dimension(getWidth() / 2, getHeight());
    JSplitPane pane = new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            create("Color", size, new MatteBorder(insets, RED)),
            create("Icon", size, new MatteBorder(insets, this)));
    pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
    add(pane);
}
 
Example 9
Source File: Test6910490.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init() {
    Insets insets = new Insets(10, 10, 10, 10);
    Dimension size = new Dimension(getWidth() / 2, getHeight());
    JSplitPane pane = new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            create("Color", size, new MatteBorder(insets, RED)),
            create("Icon", size, new MatteBorder(insets, this)));
    pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
    add(pane);
}
 
Example 10
Source File: CodeEditor.java    From CQL with GNU Affero General Public License v3.0 5 votes vote down vote up
private void situateNotElongated() {
	JPanel cp = new JPanel(new BorderLayout());
	cp.add(sp);
	cp.add(errorStrip, BorderLayout.LINE_END);
	cp.setBorder(BorderFactory.createEtchedBorder());

	JComponent newtop = cp;

	if (enable_outline) {
		JSplitPane xx2 = new Split(.8, JSplitPane.HORIZONTAL_SPLIT);
		xx2.setDividerSize(6);

		if (outline_on_left) {
			xx2.setResizeWeight(.2);
			xx2.add(p);
			xx2.add(cp);
		} else {
			xx2.setResizeWeight(.8);
			xx2.add(cp);
			xx2.add(p);
		}
		xx2.setBorder(BorderFactory.createEmptyBorder());
		newtop = xx2;
	}

	JSplitPane xx1 = new Split(.8, JSplitPane.VERTICAL_SPLIT);
	xx1.setDividerSize(6);
	xx1.setResizeWeight(.8);
	xx1.add(newtop);
	xx1.add(respAreaX);
	xx1.setBorder(BorderFactory.createEmptyBorder());

	respAreaX.setMinimumSize(new Dimension(0, 0));

	this.removeAll();
	add(xx1);
	revalidate();
}
 
Example 11
Source File: BBoxDBGui.java    From bboxdb with Apache License 2.0 5 votes vote down vote up
/**
 * Initialize the GUI panel
 * @return 
 */
private JSplitPane buildSplitPane() {
	final JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	splitPane.setLeftComponent(getLeftPanel());
	splitPane.setOneTouchExpandable(true);
	splitPane.setDividerLocation(150);
	
	return splitPane;
}
 
Example 12
Source File: Splitter.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void computeDividerLocationWhenHidden(Component hiddenComponent) {
    if (leftComponent.isVisible() || rightComponent.isVisible()) {
        boolean horiz = getOrientation() == JSplitPane.HORIZONTAL_SPLIT;
        double size  = horiz ? getSize().getWidth() :
                               getSize().getHeight();
        double csize = horiz ? hiddenComponent.getSize().getWidth() :
                               hiddenComponent.getSize().getHeight();
        computeDividerLocation(hiddenComponent, size, csize);
    }
}
 
Example 13
Source File: SplitPaneDividerUI.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public Dimension getPreferredSize() {
	if (this.orientation == JSplitPane.HORIZONTAL_SPLIT) {
		return new Dimension(getDividerSize(), 5);
	} else {
		return new Dimension(5, getDividerSize());
	}
}
 
Example 14
Source File: ScoreTree.java    From libreveris with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Creates a new ScoreTree object.
 *
 * @param score the related score
 */
public ScoreTree (Score score)
{
    this.score = score;

    component = new JPanel();

    // Set up the tree
    model = new Model(score);

    ///model.addTreeModelListener(new ModelListener()); // Debug

    /** The tree entity */
    JTree tree = new JTree(model);

    // Build left-side view
    JScrollPane treeView = new JScrollPane(tree);

    // Build right-side view
    htmlPane = new JEditorPane("text/html", "");
    htmlPane.setEditable(false);

    JScrollPane htmlView = new JScrollPane(htmlPane);

    // Allow only single selections
    tree.getSelectionModel().setSelectionMode(
            TreeSelectionModel.SINGLE_TREE_SELECTION);

    // Display lines to explicit relationships
    tree.putClientProperty("JTree.lineStyle", "Angled");

    // Wire the two views together. Use a selection listener
    // created with an anonymous inner-class adapter.
    // Listen for when the selection changes.
    tree.addTreeSelectionListener(new SelectionListener());

    // To be notified of expansion / collapse actions (debug ...)
    ///tree.addTreeExpansionListener(new ExpansionListener());

    // Build split-pane view
    JSplitPane splitPane = new JSplitPane(
            JSplitPane.HORIZONTAL_SPLIT,
            treeView,
            htmlView);
    splitPane.setName("treeHtmlSplitPane");
    splitPane.setContinuousLayout(true);
    splitPane.setBorder(null);
    splitPane.setDividerSize(2);

    // Add GUI components
    component.setLayout(new BorderLayout());
    component.add("Center", splitPane);
}
 
Example 15
Source File: AquaOpenLocationPaneUI.java    From pumpernickel with MIT License 4 votes vote down vote up
@Override
protected void installGUI(JComponent panel) {
	panel.addPropertyChangeListener(KEY_INCLUDE_SIDEBAR,
			propertyChangeListener);

	if (sourceList.isEmpty()) {
		File[] array1 = CommonFiles.getUserDirectories(true);
		IOLocation[] array2 = new FileLocation[array1.length];
		for (int a = 0; a < array1.length; a++) {
			array2[a] = LocationFactory.get().create(array1[a]);
		}
		sourceList.add(array2);
	}

	boolean includeSidebar = getBoolean(locationPane, KEY_INCLUDE_SIDEBAR,
			true);
	boolean includeFooter = getBoolean(locationPane, KEY_INCLUDE_FOOTER,
			true);

	panel.removeAll();
	panel.setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.gridx = 0;
	c.gridy = 0;
	c.weightx = 1;
	c.weighty = 0;
	c.fill = GridBagConstraints.HORIZONTAL;
	c.insets = new Insets(4, 0, 4, 0);
	panel.add(controls, c);
	c.gridy++;
	c.weighty = 1;
	c.fill = GridBagConstraints.BOTH;

	if (includeSidebar) {
		splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
				sourceListScrollPane, browser);
		panel.add(splitPane, c);
	} else {
		panel.add(browser, c);
	}

	if (includeFooter) {
		c.weighty = 0;
		c.gridy++;
		panel.add(footer, c);
	}
	sourceListScrollPane.setMinimumSize(new Dimension(100, 40));
	sourceListScrollPane.setPreferredSize(new Dimension(150, 40));
}
 
Example 16
Source File: javax_swing_JSplitPane.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected JSplitPane getObject() {
    return new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
}
 
Example 17
Source File: MainPanel.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
/**
 */
public MainPanel() {

  super(new BorderLayout());

  // Initialize item selector
  rawDataTree = new ProjectTree();
  peakListTree = new ProjectTree();

  JScrollPane rawDataTreeScroll = new JScrollPane(rawDataTree);
  JScrollPane peakListTreeScroll = new JScrollPane(peakListTree);

  JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  split.add(rawDataTreeScroll);
  split.add(peakListTreeScroll);
  split.setResizeWeight(0.5);

  split.setMinimumSize(new Dimension(200, 200));

  add(split, BorderLayout.CENTER);

  taskTable = new TaskProgressTable();
  add(taskTable, BorderLayout.SOUTH);

}
 
Example 18
Source File: javax_swing_JSplitPane.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected JSplitPane getObject() {
    return new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
}
 
Example 19
Source File: HistoryWindow.java    From Spark with Apache License 2.0 4 votes vote down vote up
private Component getHistoryContentPanel() {
	JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	splitPane.setLeftComponent(historyTreeView);
	splitPane.setRightComponent(getMessagesPanel());
	return splitPane;
}
 
Example 20
Source File: TestViewElement.java    From netbeans with Apache License 2.0 4 votes vote down vote up
int getSizeInSplit() {
    return orientation == JSplitPane.HORIZONTAL_SPLIT ? getComponent().getWidth() : getComponent().getHeight();
}