本文整理了Java中javax.swing.JSplitPane.getOrientation()
方法的一些代码示例,展示了JSplitPane.getOrientation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSplitPane.getOrientation()
方法的具体详情如下:
包路径:javax.swing.JSplitPane
类名称:JSplitPane
方法名:getOrientation
暂无
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
_splitPane.setDividerLocation(calculateDividerLocation(_splitPane.getOrientation(), true));
}
}
});
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
@Override
public void propertyChange(PropertyChangeEvent evt) {
if(SessionProperties.IPropertyNames.SQL_PANEL_ORIENTATION.equals(evt.getPropertyName())){
saveOrientationDependingDividerLocation();
_splitPane.setOrientation((Integer) evt.getNewValue());
_splitPane.setDividerLocation(calculateDividerLocation(_splitPane.getOrientation(), false));
_splitPane.repaint();
}
}
});
代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui
private Component getFirstComponent(JSplitPane splitPane) {
if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
return splitPane.getLeftComponent();
} else {
return splitPane.getTopComponent();
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf
@Override
protected void resetLayoutManager() {
super.resetLayoutManager();
int orientation = splitPane.getOrientation();
((NapkinSplitPaneDivider) divider).setOrientation(orientation);
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = ORIENTATION_JSDOC)
@Designable(category = "split")
@Override
public int getOrientation() {
if (super.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
return Orientation.HORIZONTAL;
} else {
return Orientation.VERTICAL;
}
}
代码示例来源:origin: de.richtercloud/flexdock-core
public static int getSplitPaneSize(JSplitPane splitPane) {
if(splitPane==null) {
return 0;
}
boolean horiz = splitPane.getOrientation()==JSplitPane.HORIZONTAL_SPLIT? true: false;
return horiz? splitPane.getWidth(): splitPane.getHeight();
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui
private Component getSecondComponent(JSplitPane splitPane) {
if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
return splitPane.getRightComponent();
} else {
return splitPane.getBottomComponent();
}
}
代码示例来源:origin: org.activecomponents.jadex/jadex-commons-gui
/**
* Get the proportional split location.
*/
public static double getProportionalDividerLocation(JSplitPane pane)
{
double full = pane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT? pane.getSize().getWidth(): pane.getSize().getHeight();
double ret = ((double)pane.getDividerLocation())/full;
return ret;
}
代码示例来源:origin: Revivius/nb-darcula
@Override
public void paint(Graphics g) {
super.paint(g);
if(splitPane.getOrientation() == JSplitPane.VERTICAL_SPLIT)
splitGlueV.paintIcon(this, g, getWidth() / 2, (getHeight() - splitGlueV.getIconHeight()) / 2);
else
splitGlueH.paintIcon(this, g, (getWidth() - splitGlueH.getIconWidth()) / 2, getHeight() / 2);
}
代码示例来源:origin: joel-costigliola/assertj-swing
@RunsInEDT
static int locationToMoveDividerTo(final @Nonnull JSplitPane splitPane, final int desiredLocation) {
Integer result = execute(() -> FINDERS.get(splitPane.getOrientation()).locationToMoveDividerTo(splitPane,
desiredLocation));
return checkNotNull(result);
}
代码示例来源:origin: nativelibs4java/JNAerator
void switchOrientation() {
boolean hor = sp.getOrientation() == JSplitPane.HORIZONTAL_SPLIT;
int l = sp.getDividerLocation(), d = hor ? sp.getWidth() : sp.getHeight();
sp.setOrientation(hor ? JSplitPane.VERTICAL_SPLIT : JSplitPane.HORIZONTAL_SPLIT);
if (d != 0) {
sp.setDividerLocation(l / (double) d);
}
}
Action switchOrientationAction = new AbstractAction("Switch Orientation") {
代码示例来源:origin: com.nativelibs4java/jnaerator
void switchOrientation() {
boolean hor = sp.getOrientation() == JSplitPane.HORIZONTAL_SPLIT;
int l = sp.getDividerLocation(), d = hor ? sp.getWidth() : sp.getHeight();
sp.setOrientation(hor ? JSplitPane.VERTICAL_SPLIT : JSplitPane.HORIZONTAL_SPLIT);
if (d != 0) {
sp.setDividerLocation(l / (double) d);
}
}
Action switchOrientationAction = new AbstractAction("Switch Orientation") {
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui
@Override
public void propertyChange(PropertyChangeEvent evt) {
DividerSettings dividerSettings = new DividerSettings(splitPane.getOrientation(), splitPane.getDividerLocation());
TestRunnerSettings.getDefault().setDividerSettings(dividerSettings);
}
});
代码示例来源:origin: de.richtercloud/flexdock-core
public static float getDividerProportion(JSplitPane splitPane) {
if(splitPane==null) {
return 0;
}
int size = splitPane.getOrientation()==JSplitPane.HORIZONTAL_SPLIT? splitPane.getWidth(): splitPane.getHeight();
int divLoc = splitPane.getDividerLocation();
return size==0? 0: divLoc/((float)size - splitPane.getDividerSize());
}
代码示例来源:origin: nativelibs4java/JNAerator
protected static double getProportionalDividerLocation(JSplitPane sp) {
boolean hor = sp.getOrientation() == JSplitPane.HORIZONTAL_SPLIT;
int l = sp.getDividerLocation(), d = hor ? sp.getWidth() : sp.getHeight();
sp.setOrientation(hor ? JSplitPane.VERTICAL_SPLIT : JSplitPane.HORIZONTAL_SPLIT);
return d != 0 ? l / (double) d : 0.5;
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui
@Override
public void propertyChange(PropertyChangeEvent evt) {
DividerSettings dividerSettings = new DividerSettings(splitPane.getOrientation(), splitPane.getDividerLocation());
TestRunnerSettings.getDefault().setDividerSettings(dividerSettings);
}
});
代码示例来源:origin: com.nativelibs4java/jnaerator
protected static double getProportionalDividerLocation(JSplitPane sp) {
boolean hor = sp.getOrientation() == JSplitPane.HORIZONTAL_SPLIT;
int l = sp.getDividerLocation(), d = hor ? sp.getWidth() : sp.getHeight();
sp.setOrientation(hor ? JSplitPane.VERTICAL_SPLIT : JSplitPane.HORIZONTAL_SPLIT);
return d != 0 ? l / (double) d : 0.5;
}
}
代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime
@Override
public State getState(Object o) {
JSplitPane p = checkComponent(o);
JSplitPaneState result = new JSplitPaneState();
result.setDividerLocation(p.getUI().getDividerLocation(p));
result.setOrientation(p.getOrientation());
return result;
}
代码示例来源:origin: org.nuiton/nuiton-widgets
@Override
public State getState(Object o) {
JSplitPane p = checkComponent(o);
JSplitPaneState result = new JSplitPaneState();
result.setDividerLocation(p.getUI().getDividerLocation(p));
result.setOrientation(p.getOrientation());
return result;
}
代码示例来源:origin: net.sf.taverna.t2.ui-impl/zaria
public SwitchOrientationAction() {
super();
if (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
putValue(Action.SHORT_DESCRIPTION, "Switch to horizontal split");
putValue(Action.SMALL_ICON, ZIcons
.iconFor("converttohorizontalsplit"));
} else {
putValue(Action.SHORT_DESCRIPTION, "Switch to vertical split");
putValue(Action.SMALL_ICON, ZIcons
.iconFor("converttoverticalsplit"));
}
}
内容来源于网络,如有侵权,请联系作者删除!