javax.swing.JSplitPane#HORIZONTAL_SPLIT源码实例Demo

下面列出了javax.swing.JSplitPane#HORIZONTAL_SPLIT 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: osp   文件: FourierPanel.java
/**
 * 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);
}
 
/**
 * 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);
    }
}
 
源代码3 项目: netbeans   文件: JExtendedSplitPane.java
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);
    }
}
 
源代码4 项目: openvisualtraceroute   文件: MainPanel.java
/**
 * 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();
}
 
源代码5 项目: rapidminer-studio   文件: SplitPaneDividerUI.java
@Override
public Dimension getPreferredSize() {
	if (this.orientation == JSplitPane.HORIZONTAL_SPLIT) {
		return new Dimension(getDividerSize(), 5);
	} else {
		return new Dimension(5, getDividerSize());
	}
}
 
源代码6 项目: netbeans   文件: ClassesControllerUI.java
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());
                }
            }
        });
}
 
源代码7 项目: visualvm   文件: Splitter.java
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);
    }
}
 
源代码8 项目: bboxdb   文件: BBoxDBGui.java
/**
 * 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;
}
 
源代码9 项目: CQL   文件: CodeEditor.java
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();
}
 
源代码10 项目: jdk8u-jdk   文件: Test6910490.java
@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);
}
 
源代码11 项目: openjdk-8   文件: Test6910490.java
@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);
}
 
源代码12 项目: mzmine2   文件: FeatureOverviewWindow.java
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;
}
 
源代码13 项目: binnavi   文件: CDebugEventListPanel.java
/**
 * 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);
}
 
源代码14 项目: openjdk-jdk8u   文件: javax_swing_JSplitPane.java
protected JSplitPane getObject() {
    return new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
}
 
源代码15 项目: libreveris   文件: ScoreTree.java
/**
 * 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);
}
 
源代码16 项目: pumpernickel   文件: AquaOpenLocationPaneUI.java
@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));
}
 
源代码17 项目: mzmine2   文件: MainPanel.java
/**
 */
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);

}
 
源代码18 项目: TencentKona-8   文件: javax_swing_JSplitPane.java
protected JSplitPane getObject() {
    return new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
}
 
源代码19 项目: Spark   文件: HistoryWindow.java
private Component getHistoryContentPanel() {
	JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	splitPane.setLeftComponent(historyTreeView);
	splitPane.setRightComponent(getMessagesPanel());
	return splitPane;
}
 
源代码20 项目: netbeans   文件: TestViewElement.java
int getSizeInSplit() {
    return orientation == JSplitPane.HORIZONTAL_SPLIT ? getComponent().getWidth() : getComponent().getHeight();
}