本文整理汇总了Java中javax.swing.JSplitPane类的典型用法代码示例。如果您正苦于以下问题:Java JSplitPane类的具体用法?Java JSplitPane怎么用?Java JSplitPane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JSplitPane类属于javax.swing包,在下文中一共展示了JSplitPane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractTreeEditor
import javax.swing.JSplitPane; //导入依赖的package包/类
public AbstractTreeEditor()
{
tree = createTree();
tree.addTreeSelectionListener(this);
tree.setPreferredSize(new Dimension(325, 0));
tree.setMinimumSize(new Dimension(325, 0));
// Ensure the root nodes start loading
tree.loadChildren(tree.getRootNode());
editArea = new JPanel(new GridLayout(1, 1));
AppletGuiUtils.removeBordersFromSplitPane(this);
setOrientation(JSplitPane.HORIZONTAL_SPLIT);
setContinuousLayout(true);
setResizeWeight(0.05);
add(tree, JSplitPane.LEFT);
add(editArea, JSplitPane.RIGHT);
noSelectionEditor = new BasicMessageEditor(
CurrentLocale.get("com.tle.admin.gui.common.tree.nodeeditor.nonodeselected"));
showTreeNodeEditor(noSelectionEditor);
}
示例2: selectSplitPaneDividerLocation
import javax.swing.JSplitPane; //导入依赖的package包/类
public void selectSplitPaneDividerLocation() throws InterruptedException {
final LoggingRecorder lr = new LoggingRecorder();
siw(new Runnable() {
@Override public void run() {
JSplitPane splitPane = (JSplitPane) ComponentUtils.findComponent(JSplitPane.class, frame);
splitPane.setDividerLocation(300);
BasicSplitPaneDivider divider = (BasicSplitPaneDivider) ComponentUtils.findComponent(BasicSplitPaneDivider.class,
splitPane);
RSplitPane rDivider = new RSplitPane(divider, null, null, lr);
rDivider.mouseReleased(null);
}
});
Call call = lr.getCall();
AssertJUnit.assertEquals("select", call.getFunction());
AssertJUnit.assertEquals("300", call.getState());
}
示例3: ServiceTimesPanel
import javax.swing.JSplitPane; //导入依赖的package包/类
public ServiceTimesPanel(ServiceTimesParametricAnalysis stpa, ClassDefinition classDef, StationDefinition stationDef, SimulationDefinition simDef) {
super();
STPA = stpa;
super.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
super.setDividerSize(3);
DESCRIPTION = "Repeat the simulation with different service times of a station for" + " the jobs of all the classes.\n\n"
+ "The 'To' value represents the proportion of the final service time with" + " respect to the initial value.\n\n"
+ "The 'all class proportionally' option"
+ " will not be enabled for those stations where at least one of the two following conditions is true:\n"
+ " - there is at least one class with a service time distribution with infinite or null mean value;\n"
+ " - there is at least one load dependent class";
DESCRIPTION_SINGLE = "Repeat the simulation changing the service time of a station for" + " one class only.\n\n"
+ "The 'To' value represents the final mean value of service time distribution.";
cd = classDef;
sd = stationDef;
simd = simDef;
checker = new ParametricAnalysisChecker(cd, sd, simd);
initialize();
}
示例4: ViewTreeGroups
import javax.swing.JSplitPane; //导入依赖的package包/类
public ViewTreeGroups(String directory) {
//super("JTree FileSystem Viewer - JavaProgrammingForums.com");
setTitle("GroupsTree Structure");
fileDetailsTextArea.setEditable(false);
fileSystemModel = new FileSystemModel(new File(directory));
fileTree = new JTree(fileSystemModel);
fileTree.setEditable(true);
fileTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent event) {
File file = (File) fileTree.getLastSelectedPathComponent();
fileDetailsTextArea.setText(getFileDetails(file));
}
});
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
true, new JScrollPane(fileTree), new JScrollPane(
fileDetailsTextArea));
getContentPane().add(splitPane);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(640, 480);
setVisible(true);
}
开发者ID:cyberheartmi9,项目名称:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代码行数:22,代码来源:ViewTreeGroups.java
示例5: addChart
import javax.swing.JSplitPane; //导入依赖的package包/类
/**
* It creates a chart for the given dataset and adds the chart to the panel.
*
* @param dataset The dataset that will provide the values for the chart.
*/
private void addChart() {
JFreeChart chart = ChartFactory.createXYBarChart(getTitle(),
"Buckets (sec)", false, "Count",
dataset, PlotOrientation.VERTICAL, true, true, false);
chart.addProgressListener(locker);
XYPlot plot = (XYPlot) chart.getPlot();
XYItemRenderer renderer = plot.getRenderer();
renderer.setToolTipGenerator(dataset);
groupActivatingPanel = new GroupActivatingPanel(dataset, locker);
org.jfree.chart.ChartPanel chartPanel =
new org.jfree.chart.ChartPanel(chart);
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
groupActivatingPanel,chartPanel);
splitPane.setDividerLocation(200);
mainPanel().add(BorderLayout.CENTER, splitPane);
}
示例6: 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;
}
示例7: isProbablyAContainer
import javax.swing.JSplitPane; //导入依赖的package包/类
/**
* Return true if the given component is likely to be a container such the each
* component within the container should be be considered as a user input.
*
* @param c
* @return true if the component children should have this listener added.
*/
protected boolean isProbablyAContainer (Component c) {
boolean result = extListener != null ? extListener.isContainer(c) : false;
if (!result) {
boolean isSwing = isSwingClass(c);
if (isSwing) {
result = c instanceof JPanel || c instanceof JSplitPane || c instanceof
JToolBar || c instanceof JViewport || c instanceof JScrollPane ||
c instanceof JFrame || c instanceof JRootPane || c instanceof
Window || c instanceof Frame || c instanceof Dialog ||
c instanceof JTabbedPane || c instanceof JInternalFrame ||
c instanceof JDesktopPane || c instanceof JLayeredPane;
} else {
result = c instanceof Container;
}
}
return result;
}
示例8: setDividerSize
import javax.swing.JSplitPane; //导入依赖的package包/类
/**
* 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);
}
}
示例9: ArrivalRatesPanel
import javax.swing.JSplitPane; //导入依赖的package包/类
public ArrivalRatesPanel(ArrivalRateParametricAnalysis arpa, ClassDefinition classDef, StationDefinition stationDef, SimulationDefinition simDef) {
super();
ARPA = arpa;
super.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
super.setDividerSize(3);
DESCRIPTION = "Repeat the simulation with different arrival rate for all open " + "classes.\n\n"
+ "The 'To' value represents the percentage of the final arrival rate with" + " respect to the initial value.\n\n"
+ "This option will not be available if there is at least one"
+ " open class with an interarrival time distribution with infinite or null mean value.\n\n";
DESCRIPTION_SINGLE = "Repeat the simulation with different arrival rates for an open "
+ "classes, provided that the interarrival time distribution has a finite, not null, mean value. "
+ "The 'To' value is the final arrival rate.\n\n ";
cd = classDef;
sd = stationDef;
simd = simDef;
checker = new ParametricAnalysisChecker(cd, sd, simd);
initialize();
}
示例10: computeDividerLocationWhenHidden
import javax.swing.JSplitPane; //导入依赖的package包/类
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);
}
}
示例11: computeDividerLocationWhenInitiallyHidden
import javax.swing.JSplitPane; //导入依赖的package包/类
private void computeDividerLocationWhenInitiallyHidden(Component hiddenComponent) {
if (getTopComponent().isVisible() || getBottomComponent().isVisible()) {
if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
if (hiddenComponent == getFirstComponent()) {
dividerLocation = hiddenComponent.getPreferredSize().width / (getPreferredSize().getWidth() - dividerSize);
} else {
dividerLocation = (getPreferredSize().getWidth() - dividerSize - hiddenComponent.getPreferredSize().width) / (getPreferredSize()
.getWidth()
- dividerSize);
}
} else {
if (hiddenComponent == getFirstComponent()) {
dividerLocation = hiddenComponent.getPreferredSize().height / (getPreferredSize().getHeight() - dividerSize);
} else {
dividerLocation = (getPreferredSize().getHeight() - dividerSize - hiddenComponent.getPreferredSize().height) / (getPreferredSize()
.getHeight()
- dividerSize);
}
}
dividerLocation = Math.max(0, dividerLocation);
dividerLocation = Math.min(1, dividerLocation);
}
}
示例12: removeBordersFromSplitPane
import javax.swing.JSplitPane; //导入依赖的package包/类
public static void removeBordersFromSplitPane(JSplitPane split)
{
// remove the border from the split pane
split.setBorder(null);
// check the UI. If we can't work with the UI any further, then
// exit here.
if( !(split.getUI() instanceof BasicSplitPaneUI) )
{
return;
}
// grab the divider from the UI and remove the border from it
final BasicSplitPaneDivider divider = ((BasicSplitPaneUI) split.getUI()).getDivider();
if( divider != null )
{
// Taken from http://forums.sun.com/thread.jspa?threadID=566152
divider.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0),
new SplitPaneBorder(UIManager.getColor("SplitPane.background")))); //$NON-NLS-1$
}
}
示例13: configureSecondComponent
import javax.swing.JSplitPane; //导入依赖的package包/类
private void configureSecondComponent() {
JSplitPane secondSplit = (JSplitPane) getSecondComponent();
int newWidth = secondSplit.getMinimumSize().width;
int newHeight = 0;
if (getFirstComponent(secondSplit).isVisible() && getSecondComponent(secondSplit).isVisible()) {
newHeight = getSecondComponent(secondSplit).getSize().height
+ (getFirstComponent(secondSplit).isVisible()
? (getFirstComponent(secondSplit).getMinimumSize().height + secondSplit.getDividerSize()) : 0);
} else if (getFirstComponent(secondSplit).isVisible()) {
newHeight = getFirstComponent(secondSplit).getMinimumSize().height;
} else {
newHeight = getSecondComponent(secondSplit).getMinimumSize().height;
}
secondSplit.setMinimumSize(new Dimension(newWidth, newHeight));
}
示例14: initComponents
import javax.swing.JSplitPane; //导入依赖的package包/类
private void initComponents() {
this.setLayout(new BorderLayout());
//building mainPanel
mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
mainPanel.setDividerSize(4);
mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
//layout of main panel
WarningScrollTable jsp = new WarningScrollTable(joinStrategies, WARNING_CLASS);
jsp.setBorder(new TitledBorder(new EtchedBorder(), "Join Strategies"));
mainPanel.setResizeWeight(1.0);
jsp.setMinimumSize(new Dimension(200, 100));
mainPanel.setLeftComponent(jsp);
joinEditor.setMinimumSize(new Dimension(225, 100));
mainPanel.setRightComponent(joinEditor);
add(mainPanel, BorderLayout.CENTER);
}
示例15: ArrivalRatesPanel
import javax.swing.JSplitPane; //导入依赖的package包/类
public ArrivalRatesPanel(ArrivalRateParametricAnalysis arpa, ClassDefinition classDef, StationDefinition stationDef, SimulationDefinition simDef) {
super();
ARPA = arpa;
super.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
super.setDividerSize(3);
DESCRIPTION = "Repeat the simulation with different arrival rate for all open " + "classes.\n\n"
+ "The 'To' value represents the percentage of the final arrival rate with" + " respect to the initial value.\n\n"
+ "This option will not be available if there is at least one"
+ " open class with an interarrival time distribution with infinite or null mean value.\n\n";
DESCRIPTION_SINGLE = "Repeat the simulation with different arrival rates for an open "
+ "classes, provided that the interarrival time distribution has a finite, positive, mean value. "
+ "The 'To' value is the final arrival rate.\n\n ";
cd = classDef;
sd = stationDef;
simd = simDef;
checker = new ParametricAnalysisChecker(cd, sd, simd);
initialize();
}