当前位置: 首页>>代码示例>>Java>>正文


Java JSplitPane.setDividerLocation方法代码示例

本文整理汇总了Java中javax.swing.JSplitPane.setDividerLocation方法的典型用法代码示例。如果您正苦于以下问题:Java JSplitPane.setDividerLocation方法的具体用法?Java JSplitPane.setDividerLocation怎么用?Java JSplitPane.setDividerLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JSplitPane的用法示例。


在下文中一共展示了JSplitPane.setDividerLocation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildDisplay

import javax.swing.JSplitPane; //导入方法依赖的package包/类
@Override
protected void buildDisplay() {
    JPanel queryPane = new JPanel(new BorderLayout());
    JLabel leading = new JLabel(" ?- ");
    leading.setFont(leading.getFont().deriveFont(Font.BOLD));
    queryPane.add(leading, BorderLayout.WEST);
    queryPane.add(getQueryField(), BorderLayout.CENTER);
    JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
    buttonsPane.add(createExecuteButton());
    buttonsPane.add(getNextResultButton());
    buttonsPane.setBorder(null);
    queryPane.add(buttonsPane, BorderLayout.EAST);

    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(.4);
    splitPane.setBottomComponent(getTabPane());
    splitPane.setTopComponent(getResultsPanel());

    JPanel mainPane = new JPanel(new BorderLayout());
    mainPane.add(queryPane, BorderLayout.NORTH);
    mainPane.add(splitPane, BorderLayout.CENTER);

    setLayout(new BorderLayout());
    add(mainPane, BorderLayout.CENTER);
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:27,代码来源:PrologDisplay.java

示例2: initUI

import javax.swing.JSplitPane; //导入方法依赖的package包/类
private void initUI() {
	setTitle(BUNDLE.getString("MainFrame.this.title"));
	setPreferredSize(new Dimension(800, 600));
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	setBounds(100, 100, 1024, 768);

	contentPane = new JPanel();
	contentPane.setPreferredSize(new Dimension(800, 600));
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	contentPane.setLayout(new BorderLayout(0, 0));
	centerPane = new JSplitPane();
	contentPane.add(centerPane, BorderLayout.CENTER);
	centerPane.setDividerLocation(200);

	initMenu();
	initStatusbar();
	initSidePane();
	initToolbar();
	initWorkspace();
}
 
开发者ID:roscisz,项目名称:KernelHive,代码行数:22,代码来源:MainFrame.java

示例3: getDisplaysInfoPanel

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
 * Lazily creates and returns the split pane
 * containing the displays and info panels.
 */
JSplitPane getDisplaysInfoPanel() {
    JSplitPane result = this.displaysInfoPanel;
    if (result == null) {
        this.displaysInfoPanel = result = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
        result.setLeftComponent(getDisplaysPanel());
        result.setRightComponent(getDisplaysPanel().getInfoPanel());
        result.setOneTouchExpandable(true);
        result.setResizeWeight(1);
        result.setDividerLocation(0.8);
        result.setContinuousLayout(true);
        result.setBorder(null);
        ToolTipManager.sharedInstance()
            .registerComponent(result);
    }
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:21,代码来源:Simulator.java

示例4: updateSplitLocation

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
 * TODO: to remove? doesn't seems to be used anywhere.
 */
protected void updateSplitLocation(JSplitPane split, int foo) {
  Component left = split.getLeftComponent();
  Component right = split.getRightComponent();
  if(left == null) {
    split.setDividerLocation(0);
    return;
  }
  if(right == null) {
    split.setDividerLocation(1);
    return;
  }
  Dimension leftPS = left.getPreferredSize();
  Dimension rightPS = right.getPreferredSize();
  double location =
      split.getOrientation() == JSplitPane.HORIZONTAL_SPLIT
          ? (double)leftPS.width / (leftPS.width + rightPS.width)
          : (double)leftPS.height / (leftPS.height + rightPS.height);
  split.setDividerLocation(location);
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:23,代码来源:DocumentEditor.java

示例5: doLayout

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
 * Overridden to handle our layout requirements
 */
public void doLayout() {
    Component[] c = getComponents();

    if (c.length > 0 && getWidth() >= 0 && getHeight() >= 0) {
        Insets ins = getInsets();
        c[0].setBounds(ins.left, ins.top, getWidth() - (ins.right + ins.left), getHeight() - ins.top + ins.bottom);

        if (c[0] instanceof JSplitPane && Boolean.TRUE.equals(firstSplit)) {
            JSplitPane pane = (JSplitPane) c[0];
            pane.setDividerLocation(0.80f);
            pane.resetToPreferredSizes();

            JComponent dc = findDescriptionComponent();

            if (dc != null) {
                if (dc.getHeight() > 0) {
                    firstSplit = Boolean.FALSE;
                }
            } else {
                firstSplit = Boolean.FALSE;
            }
        }

        if (c.length > 1) {
            throw new IllegalStateException("Hmm, something is wrong: " + Arrays.asList(c));
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:PSheet.java

示例6: createSplitPane

import javax.swing.JSplitPane; //导入方法依赖的package包/类
private JSplitPane createSplitPane(Component lower) {
    JSplitPane pane = new JSplitPane();

    if (firstSplit == null) {
        firstSplit = Boolean.TRUE;
    } else {
        firstSplit = Boolean.FALSE;
    }

    pane.setRightComponent(lower);
    pane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    pane.setContinuousLayout(true);
    pane.setResizeWeight(1);
    pane.setDividerLocation(0.80f);
    pane.setBorder(BorderFactory.createEmptyBorder());
    //Do not install our custom split pane UI on Nimbus L&F
    if (!"Nimbus".equals(UIManager.getLookAndFeel().getID())) {
        pane.setUI(PropUtils.createSplitPaneUI());
    }

    // #52188: default F6 behaviour doesn't make to much sense in NB 
    // property sheet and blocks NetBeans default F6
    pane.getActionMap().getParent().remove("toggleFocus");
    if( PropUtils.isAqua ) {
        pane.setBackground( UIManager.getColor("NbExplorerView.background") ); //NOI18N
    }

    return pane;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:PSheet.java

示例7: erzeugeAuflisterPanel

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
 * Erzeugt das Panel für die Anzeige der Kunden- und Medien-Tabelle, die
 * durch eine Splittpane voneinander getrennt sind.
 * 
 */
private void erzeugeAuflisterPanel()
{
    JPanel auflisterPanel = new JPanel();
    _hauptPanel.add(auflisterPanel, BorderLayout.CENTER);
    auflisterPanel.setLayout(new BorderLayout());
    setNoSize(auflisterPanel);
    auflisterPanel.setBackground(UIConstants.BACKGROUND_COLOR);

    _auflisterSplitpane = new JSplitPane();
    auflisterPanel.add(_auflisterSplitpane, BorderLayout.CENTER);
    _auflisterSplitpane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    _auflisterSplitpane.setOneTouchExpandable(true);
    _auflisterSplitpane.setDividerLocation(300);

    setNoSize(_auflisterSplitpane);
    _auflisterSplitpane.setContinuousLayout(true);
    _auflisterSplitpane.setDoubleBuffered(true);
    _auflisterSplitpane.setResizeWeight(0.5);
    _auflisterSplitpane.setBackground(UIConstants.BACKGROUND_COLOR);
    _auflisterSplitpane
        .setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    // Kundendarstellung
    _auflisterSplitpane.add(_kundenauflisterPanel, JSplitPane.TOP);
    // Mediendarstellung
    _auflisterSplitpane.add(_medienauflisterPanel, JSplitPane.BOTTOM);
}
 
开发者ID:polemonium,项目名称:SE2Project,代码行数:32,代码来源:AusleiheUI.java

示例8: SplitCompilationViewer

import javax.swing.JSplitPane; //导入方法依赖的package包/类
public SplitCompilationViewer(CompilationViewer firstViewer, CompilationViewer secondViewer) {
    splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    firstPanel = createComponent(firstViewer);
    secondPanel = createComponent(secondViewer);
    splitPane.add(firstPanel);
    splitPane.add(secondPanel);
    splitPane.addPropertyChangeListener(splitChanged);
    splitPane.setDividerLocation(getLastDividerLocation());
    combinedLookup = new ProxyLookup(firstViewer.getLookup(), secondViewer.getLookup());
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:11,代码来源:SplitCompilationViewer.java

示例9: prepareControls

import javax.swing.JSplitPane; //导入方法依赖的package包/类
protected void prepareControls() {
    JFrame frame = new JFrame("SplitPane Mixing");
    JPanel p = new JPanel(new GridLayout());
    p.setPreferredSize(new Dimension(500, 500));
    propagateAWTControls(p);
    sp1 = new JScrollPane(p);

    JButton button = new JButton("JButton");
    button.setBackground(Color.RED);
    button.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            clicked = true;
        }
    });
    sp2 = new JScrollPane(button);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sp1, sp2);
    splitPane.setOneTouchExpandable(false);
    splitPane.setDividerLocation(150);

    splitPane.setPreferredSize(new Dimension(400, 200));

    frame.getContentPane().add(splitPane);
    frame.pack();
    frame.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:JSplitPaneOverlapping.java

示例10: SwingSpyPanel

import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
	 * Initialization.
	 */
	public SwingSpyPanel() {
		setPreferredSize(new Dimension(INITIAL_WIDTH, INITIAL_HEIGHT));
		setLayout(new BorderLayout());

		root = new DefaultMutableTreeNode();
		componentTree = new JTree(root);
		componentTree.setRootVisible(false);
		componentTree.setCellRenderer(new SwingComponentRenderer());
		componentTree.addTreeSelectionListener(new CustomSelectionListener());
//		add(new JScrollPane(componentTree), BorderLayout.CENTER);

		detailsData = new JEditorPane();
		detailsData.setBackground(new Color(250, 250, 250));
		detailsData.setForeground(new Color(33, 33, 33));
		detailsData.setBorder(BorderFactory.createLineBorder(new Color(100, 100, 244), 1));
		detailsData.setPreferredSize(new Dimension(150, INITIAL_HEIGHT));
		detailsData.setEditable(false);
		detailsData.setContentType("text/html");
		SwingUtil.enforceJEditorPaneFont(detailsData, font);
		detailsScrollPane = new JScrollPane(detailsData);
//		add(detailsScrollPane, BorderLayout.EAST);

		JSplitPane hPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(componentTree), detailsScrollPane);
		hPane.setContinuousLayout(true);
		hPane.setOneTouchExpandable(true);
		hPane.setDividerLocation(INITIAL_WIDTH - 200);
		add(hPane, BorderLayout.CENTER);

		componentData = new JEditorPane();
		componentData.setBackground(new Color(250, 250, 250));
		componentData.setForeground(new Color(33, 33, 33));
		componentData.setBorder(BorderFactory.createLineBorder(new Color(100, 100, 244), 1));
		componentData.setPreferredSize(new Dimension(INITIAL_WIDTH, 36));
		componentData.setEditable(false);
		componentData.setContentType("text/html");
		SwingUtil.enforceJEditorPaneFont(componentData, font);
		add(componentData, BorderLayout.SOUTH);

	}
 
开发者ID:igr,项目名称:swingspy,代码行数:43,代码来源:SwingSpyPanel.java

示例11: init

import javax.swing.JSplitPane; //导入方法依赖的package包/类
@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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:Test6910490.java

示例12: createSplitPane

import javax.swing.JSplitPane; //导入方法依赖的package包/类
private JSplitPane createSplitPane(int orientation, int location, boolean continuous, double resizeWeight, java.awt.Component component_a, java.awt.Component component_b) {
	JSplitPane split = new JSplitPane(orientation, continuous, component_a, component_b);
	split.setResizeWeight(resizeWeight);
	split.setDividerLocation(location);
	split.setOneTouchExpandable(true);
	return split;
}
 
开发者ID:kristian,项目名称:JDigitalSimulator,代码行数:8,代码来源:Application.java

示例13: EditUsersDialog

import javax.swing.JSplitPane; //导入方法依赖的package包/类
public EditUsersDialog(JFrame frame, UserFactory userFactory,
                       AdminPanelPlugin plugin, Engine engine) {
    super(frame, true);
    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    this.factory = userFactory;
    this.plugin = plugin;

    this.setTitle(plugin.getString("Action.EditUsers"));

    users = factory.getUsers();
    groups = factory.getGroups();
    qualifiers = engine.getQualifiers();

    createModels();

    createActions();

    JComponent userPanel = createUserPanel();
    JComponent groupPanel = createGroupPanel();

    JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    pane.setLeftComponent(userPanel);
    pane.setRightComponent(groupPanel);
    JToolBar panel = new JToolBar();
    panel.add(createUser).setFocusable(false);
    panel.add(editUser).setFocusable(false);
    panel.add(deleteUser).setFocusable(false);
    panel.add(createGroup).setFocusable(false);
    panel.add(deleteGroup).setFocusable(false);

    JPanel panel2 = new JPanel(new BorderLayout());
    panel2.add(panel, BorderLayout.NORTH);
    panel2.add(pane, BorderLayout.CENTER);
    pane.setDividerLocation(300);
    setMainPane(panel2);
    this.setMinimumSize(new Dimension(800, 600));
    this.setLocationRelativeTo(null);
    Options.loadOptions(this);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:40,代码来源:EditUsersDialog.java

示例14: XMCS

import javax.swing.JSplitPane; //导入方法依赖的package包/类
public XMCS( XMap map ) {
	this.map = map;
	image = createXMImage(dig1);
	imageAlt = createXMImage(dig2);
	image.setOtherImage( imageAlt );
	imageAlt.setOtherImage( image );

	// GMA 1.6.2: Changed the default split of the view area to make the view windows more visible
	imagePane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
			image.panel, imageAlt.panel );

	imagePane.setOneTouchExpandable( true );
	imagePane.setDividerLocation(imagePane.getMaximumDividerLocation() + 150);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:15,代码来源:XMCS.java

示例15: init

import javax.swing.JSplitPane; //导入方法依赖的package包/类
private void init() {
        // GraphVisualization
        RenderContext<AbstractPlanNode, PlanNodeGraph.Edge> context = this.visualizationPanel.getRenderContext();
        context.setEdgeShapeTransformer(new EdgeShape.Line<AbstractPlanNode, PlanNodeGraph.Edge>());
        context.setVertexFontTransformer(new GraphVisualizationPanel.VertexFontTransformer<AbstractPlanNode>(true));

//        PlanFragmentBoundaries boundaryPainter = new PlanFragmentBoundaries();
//        this.visualizationPanel.addPostRenderPaintable(boundaryPainter);
        
        // Full Plan Tab
        JPanel textInfoPanel = new JPanel();
        textInfoPanel.setLayout(new BorderLayout());
        JTextArea textInfoTextArea = new JTextArea();
        textInfoTextArea.setEditable(false);
        textInfoTextArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
        textInfoTextArea.setText(PlanNodeUtil.debug(this.root));
        textInfoPanel.add(new JScrollPane(textInfoTextArea), BorderLayout.CENTER);

        // Node Field Tab
        this.nodeField = new JTextArea();
        this.nodeField.setEditable(false);
        this.nodeField.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
        this.nodeField.setText("");
        JPanel textInfoPanel2 = new JPanel(new BorderLayout());
        textInfoPanel2.add(new JScrollPane(this.nodeField), BorderLayout.CENTER);
        
        this.tabbedPane = new JTabbedPane();
        this.tabbedPane.add("Full Plan", textInfoPanel);
        this.tabbedPane.add("Selected Node", textInfoPanel2);
        
        JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, visualizationPanel, this.tabbedPane);
        splitPane.setDividerLocation(AbstractViewer.DEFAULT_WINDOW_HEIGHT - 500);
        this.mainPanel.add(splitPane, BorderLayout.CENTER);
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:35,代码来源:PlanTreeCatalogNode.java


注:本文中的javax.swing.JSplitPane.setDividerLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。