本文整理汇总了Java中javax.swing.JSplitPane.setContinuousLayout方法的典型用法代码示例。如果您正苦于以下问题:Java JSplitPane.setContinuousLayout方法的具体用法?Java JSplitPane.setContinuousLayout怎么用?Java JSplitPane.setContinuousLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JSplitPane
的用法示例。
在下文中一共展示了JSplitPane.setContinuousLayout方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: splitpane
import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
* Constructs a new SplitPane containing the two components given as
* arguments
*
* @param orientation - the orientation (HORIZONTAL_SPLIT or VERTICAL_SPLIT)
* @param first - the left component (if horizontal) or top component (if
* vertical)
* @param second - the right component (if horizontal) or bottom component
* (if vertical)
* @param initialDividerLocation - the initial divider location (in pixels)
*/
public static JSplitPane splitpane(int orientation, Component first, Component second, int initialDividerLocation) {
JSplitPane x = make(new JSplitPane(orientation, first, second), new EmptyBorder(0, 0, 0, 0));
x.setContinuousLayout(true);
x.setDividerLocation(initialDividerLocation);
x.setOneTouchExpandable(false);
x.setResizeWeight(0.5);
if (Util.onMac() && (x.getUI() instanceof BasicSplitPaneUI)) {
boolean h = (orientation != JSplitPane.HORIZONTAL_SPLIT);
((BasicSplitPaneUI) (x.getUI())).getDivider().setBorder(new OurBorder(h, h, h, h)); // Makes
// the
// border
// look
// nicer
// on
// Mac
// OS
// X
}
return x;
}
示例2: getDisplayPanel
import javax.swing.JSplitPane; //导入方法依赖的package包/类
/** Lazily creates and returns the top-level display panel. */
private JSplitPane getDisplayPanel() {
JSplitPane result = this.displayPanel;
if (result == null) {
this.displayPanel = result = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
result.setTopComponent(getGraphPanel());
result.setBottomComponent(getErrorPanel());
result.setDividerSize(0);
result.setContinuousLayout(true);
result.setResizeWeight(0.9);
result.resetToPreferredSizes();
result.setBorder(null);
}
return result;
}
示例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;
}
示例4: 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;
}
示例5: 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);
}
示例6: getSplitInfoPanel
import javax.swing.JSplitPane; //导入方法依赖的package包/类
/**
* Lazily creates and returns a split panel used as info panel in case there is
* an upper and a lower panel.
*/
private JSplitPane getSplitInfoPanel() {
JSplitPane result = this.splitInfoPanel;
if (result == null) {
this.splitInfoPanel = result = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
result.setContinuousLayout(true);
result.setBorder(null);
}
return result;
}
示例7: setupGui
import javax.swing.JSplitPane; //导入方法依赖的package包/类
private void setupGui(ClientService clientService, PluginService pluginService)
{
model = new SecurityTreeModel(clientService, pluginService);
tree = new JTree(model);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setCellRenderer(new MyTreeCellRenderer());
tree.addTreeSelectionListener(this);
tabManager = new TabManager(clientService, allowEditing);
JScrollPane scroller = new JScrollPane(tree);
scroller.setMinimumSize(new Dimension(200, Integer.MAX_VALUE));
JSplitPane split = AppletGuiUtils.createSplitPane();
split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
split.setContinuousLayout(true);
split.add(scroller, JSplitPane.LEFT);
split.add(tabManager, JSplitPane.RIGHT);
JButton closeButton = new JButton(closeAction);
final int[] rows = {TableLayout.FILL, closeButton.getPreferredSize().height,};
final int[] cols = {TableLayout.FILL, closeButton.getPreferredSize().width,};
content = new JPanel(new TableLayout(rows, cols));
content.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
content.add(split, new Rectangle(0, 0, 2, 1));
content.add(closeButton, new Rectangle(1, 1, 1, 1));
updateEditor();
}
示例8: splitpane
import javax.swing.JSplitPane; //导入方法依赖的package包/类
/** Constructs a new SplitPane containing the two components given as arguments
* @param orientation - the orientation (HORIZONTAL_SPLIT or VERTICAL_SPLIT)
* @param first - the left component (if horizontal) or top component (if vertical)
* @param second - the right component (if horizontal) or bottom component (if vertical)
* @param initialDividerLocation - the initial divider location (in pixels)
*/
public static JSplitPane splitpane (int orientation, Component first, Component second, int initialDividerLocation) {
JSplitPane x = make(new JSplitPane(orientation, first, second), new EmptyBorder(0,0,0,0));
x.setContinuousLayout(true);
x.setDividerLocation(initialDividerLocation);
x.setOneTouchExpandable(false);
x.setResizeWeight(0.5);
if (Util.onMac() && (x.getUI() instanceof BasicSplitPaneUI)) {
boolean h = (orientation != JSplitPane.HORIZONTAL_SPLIT);
((BasicSplitPaneUI)(x.getUI())).getDivider().setBorder(new OurBorder(h,h,h,h)); // Makes the border look nicer on Mac OS X
}
return x;
}
示例9: 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);
}
示例10: ListWithView
import javax.swing.JSplitPane; //导入方法依赖的package包/类
public ListWithView(boolean enableUpDown, boolean enableAddRemove, TLEAction... additionalActions)
{
this.enableAddRemove = enableAddRemove;
actions = new ArrayList<TLEAction>();
for( TLEAction additionalAction : additionalActions )
{
actions.add(additionalAction);
}
actions.add(upAction);
actions.add(downAction);
actions.add(addAction);
actions.add(removeAction);
final JTextlessButton upButton = new JTextlessButton(upAction);
final JTextlessButton downButton = new JTextlessButton(downAction);
final JButton addButton = new JButton(addAction);
final JButton removeButton = new JButton(removeAction);
list = new JList<>(model);
list.addMouseListener(new ListPopupListener(list, actions));
list.addListSelectionListener(new ListSelectionListener()
{
@Override
public void valueChanged(ListSelectionEvent e)
{
onListSelectionChange();
update();
}
});
final JPanel left = new JPanel(new MigLayout("insets 0, fill, wrap 5, hidemode 2", "[][grow][][][grow]",
"[grow][][][grow][]"));
left.add(new JScrollPane(list), "skip, grow, span 4 4");
left.add(upButton);
left.add(downButton);
left.add(addButton, "skip 3, align right");
left.add(removeButton);
if( !enableUpDown )
{
upButton.setVisible(false);
downButton.setVisible(false);
}
if( !enableAddRemove )
{
addButton.setVisible(false);
removeButton.setVisible(false);
}
// This makes the left-panel more "stable" and reliable in the splitter.
left.setMinimumSize(new Dimension(200, 0));
left.setPreferredSize(left.getMaximumSize());
JSplitPane split = AppletGuiUtils.createSplitPane();
split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
split.setContinuousLayout(true);
split.setResizeWeight(0.1);
split.add(left, JSplitPane.LEFT);
split.add(editorContainer, JSplitPane.RIGHT);
setLayout(new GridLayout(1, 1));
add(split);
update();
}