當前位置: 首頁>>代碼示例>>Java>>正文


Java JSplitPane類代碼示例

本文整理匯總了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);
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:26,代碼來源:AbstractTreeEditor.java

示例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());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:17,代碼來源:RSplitPaneTest.java

示例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();
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:22,代碼來源:ServiceTimesPanel.java

示例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);
}
 
開發者ID:vimerzhao,項目名稱:gchisto,代碼行數:24,代碼來源:ChartPanelSingle.java

示例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;
}
 
開發者ID:AlloyTools,項目名稱:org.alloytools.alloy,代碼行數:32,代碼來源:OurUtil.java

示例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;
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:25,代碼來源:GenericListener.java

示例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);
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:24,代碼來源:MotifSplitPaneDivider.java

示例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();
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:22,代碼來源:ArrivalRatesPanel.java

示例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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:JExtendedSplitPane.java

示例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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:JExtendedSplitPane.java

示例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$
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:22,代碼來源:AppletGuiUtils.java

示例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));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:JCompoundSplitPane.java

示例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);
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:17,代碼來源:JoinSectionPanel.java

示例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();
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:22,代碼來源:ArrivalRatesPanel.java


注:本文中的javax.swing.JSplitPane類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。