本文整理汇总了Java中org.jdesktop.swingx.JXCollapsiblePane.Direction类的典型用法代码示例。如果您正苦于以下问题:Java Direction类的具体用法?Java Direction怎么用?Java Direction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Direction类属于org.jdesktop.swingx.JXCollapsiblePane包,在下文中一共展示了Direction类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: DCCollapsiblePanel
import org.jdesktop.swingx.JXCollapsiblePane.Direction; //导入依赖的package包/类
public DCCollapsiblePanel(final String collapsedText, final String expandedText, final boolean collapsed,
final Supplier<? extends JComponent> componentRef) {
_collapsedText = collapsedText;
_expandedText = expandedText;
_collapsiblePane = WidgetFactory.createCollapsiblePane(Direction.DOWN);
_componentRef = componentRef;
if (collapsed) {
_label = DCLabel.dark(collapsedText);
collapse();
} else {
_label = DCLabel.dark(expandedText);
expand();
}
_label.setFont(WidgetUtils.FONT_HEADER2);
_label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
_label.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
toggle();
}
});
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:24,代码来源:DCCollapsiblePanel.java
示例2: CrosstabPanel
import org.jdesktop.swingx.JXCollapsiblePane.Direction; //导入依赖的package包/类
public CrosstabPanel(final DCTable table) {
super();
_table = table;
setLayout(new BorderLayout());
final JComponent tableComponent;
if ("".equals(table.getColumnName(1))) {
tableComponent = table;
} else {
tableComponent = table.toPanel();
}
final JXCollapsiblePane chartContainer = WidgetFactory.createCollapsiblePane(Direction.UP);
chartContainer.setCollapsed(true);
_displayChartCallback = new DisplayChartCallbackImpl(chartContainer);
add(chartContainer, BorderLayout.NORTH);
add(tableComponent, BorderLayout.CENTER);
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:22,代码来源:CrosstabPanel.java
示例3: createCollapsiblePane
import org.jdesktop.swingx.JXCollapsiblePane.Direction; //导入依赖的package包/类
public static JXCollapsiblePane createCollapsiblePane(final Direction direction) {
final JXCollapsiblePane collapsiblePane = new JXCollapsiblePane(direction);
collapsiblePane.setOpaque(false);
// hack to make it non-opaque!
try {
final Field field = JXCollapsiblePane.class.getDeclaredField("wrapper");
field.setAccessible(true);
final JViewport viewPort = (JViewport) field.get(collapsiblePane);
viewPort.setOpaque(false);
final JComponent component = (JComponent) viewPort.getView();
component.setOpaque(false);
} catch (final Exception e) {
logger.info("Failed to make JXCollapsiblePane non-opaque", e);
}
return collapsiblePane;
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:18,代码来源:WidgetFactory.java
示例4: interactiveDirectionTest
import org.jdesktop.swingx.JXCollapsiblePane.Direction; //导入依赖的package包/类
/**
* SwingX 578: Ensure that the directions work correctly.
*/
public void interactiveDirectionTest() {
JXCollapsiblePane north = new JXCollapsiblePane(Direction.UP);
JLabel label = new JLabel("<html>north1<br>north2<br>north3<br>north4<br>north5<br>north6</html>");
label.setHorizontalAlignment(SwingConstants.CENTER);
north.add(label);
JXCollapsiblePane south = new JXCollapsiblePane(Direction.DOWN);
label = new JLabel("<html>south1<br>south2<br>south3<br>south4<br>south5<br>south6</html>");
label.setHorizontalAlignment(SwingConstants.CENTER);
south.add(label);
JXCollapsiblePane west = new JXCollapsiblePane(Direction.LEFT);
west.add(new JLabel("west1west2west3west4west5west6"));
JXCollapsiblePane east = new JXCollapsiblePane(Direction.RIGHT);
east.add(new JLabel("east1east2east3east4east5east6"));
JPanel panel = new JPanel(new GridLayout(2, 2));
JButton button = new JButton(north.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
button.setText("UP");
panel.add(button);
button = new JButton(south.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
button.setText("DOWN");
panel.add(button);
button = new JButton(west.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
button.setText("LEFT");
panel.add(button);
button = new JButton(east.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
button.setText("RIGHT");
panel.add(button);
JFrame frame = wrapInFrame(panel, "Direction Animation Test");
frame.add(north, BorderLayout.NORTH);
frame.add(south, BorderLayout.SOUTH);
frame.add(west, BorderLayout.WEST);
frame.add(east, BorderLayout.EAST);
frame.pack();
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:40,代码来源:JXCollapsiblePaneVisualCheck.java
示例5: interactiveBidiDirectionTest
import org.jdesktop.swingx.JXCollapsiblePane.Direction; //导入依赖的package包/类
/**
* SwingX 839: Ensure that the directions work correctly.
*/
public void interactiveBidiDirectionTest() {
JXCollapsiblePane start = new JXCollapsiblePane(Direction.START);
JLabel label = new JLabel("<html>start1<br>start2<br>start3<br>start4<br>start5<br>start6</html>");
label.setHorizontalAlignment(SwingConstants.CENTER);
start.add(label);
JXCollapsiblePane end = new JXCollapsiblePane(Direction.END);
label = new JLabel("<html>end1<br>end2<br>end3<br>end4<br>end5<br>end6</html>");
label.setHorizontalAlignment(SwingConstants.CENTER);
end.add(label);
JXCollapsiblePane leading = new JXCollapsiblePane(Direction.LEADING);
leading.add(new JLabel("leading1leading2leading3leading4leading5leading6"));
JXCollapsiblePane trailing = new JXCollapsiblePane(Direction.TRAILING);
trailing.add(new JLabel("traling1trailing2trailing3trailing4trailing5trailing6"));
JPanel panel = new JPanel(new GridLayout(2, 2));
JButton button = new JButton(start.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
button.setText("START");
panel.add(button);
button = new JButton(end.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
button.setText("END");
panel.add(button);
button = new JButton(leading.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
button.setText("LEADING");
panel.add(button);
button = new JButton(trailing.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));
button.setText("TRAILING");
panel.add(button);
JFrame frame = wrapInFrame(panel, "Direction Animation Test");
frame.add(start, BorderLayout.PAGE_START);
frame.add(end, BorderLayout.PAGE_END);
frame.add(leading, BorderLayout.LINE_START);
frame.add(trailing, BorderLayout.LINE_END);
frame.pack();
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:40,代码来源:JXCollapsiblePaneVisualCheck.java
示例6: createSeparatorScriptParamComponent
import org.jdesktop.swingx.JXCollapsiblePane.Direction; //导入依赖的package包/类
/**
* Creates a new collapsible container for a script param group.
* @param separatorScriptParam
* @return container
*/
public JXCollapsiblePane createSeparatorScriptParamComponent(SeparatorScriptParam separatorScriptParam) {
final JXCollapsiblePane panel = new JXCollapsiblePane(Direction.DOWN);
panel.setAnimated(false);
panel.setLayout(new VerticalLayout());
panel.setCollapsed(separatorScriptParam.isCollapsed());
installParamListener(panel, separatorScriptParam);
installSeparatorParamListener(panel, separatorScriptParam);
return panel;
}
开发者ID:phon-ca,项目名称:phon,代码行数:17,代码来源:ParamComponentFactory.java
示例7: init
import org.jdesktop.swingx.JXCollapsiblePane.Direction; //导入依赖的package包/类
private void init() {
setLayout(new BorderLayout());
toolbar = setupToolbar();
add(toolbar, BorderLayout.NORTH);
final JButton saveAllButton = new JButton(new SaveAllBuffersAction(this));
final ImageIcon closeIcon = IconManager.getInstance().getIcon("actions/list-remove", IconSize.SMALL);
final PhonUIAction closeBuffersAct = new PhonUIAction(this, "onRemoveSelectedBuffers");
closeBuffersAct.putValue(PhonUIAction.SMALL_ICON, closeIcon);
closeBuffersAct.putValue(PhonUIAction.SHORT_DESCRIPTION, "Close selected buffers");
closeBuffersAct.putValue(PhonUIAction.NAME, "Close");
final JButton closeBtn = new JButton(closeBuffersAct);
bufferList = setupTable();
final JScrollPane scroller = new JScrollPane(bufferList);
final FormLayout layout = new FormLayout(
"left:pref, fill:200px:grow, right:pref, pref",
"pref, pref, pref, fill:pref:grow");
final CellConstraints cc = new CellConstraints();
final JPanel leftPanel = new JPanel(layout);
leftPanel.add(saveAllButton, cc.xy(1, 1));
leftPanel.add(closeBtn, cc.xy(3, 1));
leftPanel.add(scroller, cc.xywh(1, 2, 3, 3));
cardLayout = new CardLayout();
bufferPanel = new JPanel(cardLayout);
bufferPanel.add(createNoSelectionPanel(), "no_selection");
leftPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
// splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, bufferPanel);
// splitPane.setOneTouchExpandable(true);
// splitPane.setResizeWeight(0.0);
listPane = new JXCollapsiblePane(Direction.LEFT);
listPane.getContentPane().setLayout(new BorderLayout());
listPane.getContentPane().add(leftPanel, BorderLayout.CENTER);
listPane.setCollapsed(true);
add(listPane, BorderLayout.WEST);
add(bufferPanel, BorderLayout.CENTER);
}
开发者ID:phon-ca,项目名称:phon,代码行数:47,代码来源:MultiBufferPanel.java
注:本文中的org.jdesktop.swingx.JXCollapsiblePane.Direction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论