javax.swing.JSplitPane.getDividerLocation()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中javax.swing.JSplitPane.getDividerLocation()方法的一些代码示例,展示了JSplitPane.getDividerLocation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSplitPane.getDividerLocation()方法的具体详情如下:
包路径:javax.swing.JSplitPane
类名称:JSplitPane
方法名:getDividerLocation

JSplitPane.getDividerLocation介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

public int getSplitDividerLocation() {
  if (jSplitPane1 == null) {
    return 0;
  }
  return this.jSplitPane1.getDividerLocation();
}

代码示例来源:origin: apache/pdfbox

private void replaceRightComponent(Component pane)
{
  int div = jSplitPane1.getDividerLocation();
  jSplitPane1.setRightComponent(pane);
  jSplitPane1.setDividerLocation(div);
}

代码示例来源:origin: magefree/mage

private void saveDividerLocations() {
  // save panel sizes and divider locations.
  Rectangle rec = MageFrame.getDesktop().getBounds();
  String sb = Double.toString(rec.getWidth()) + 'x' + Double.toString(rec.getHeight());
  PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb);
  PreferencesDialog.saveValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_0, Integer.toString(this.jSplitPane0.getDividerLocation()));
  PreferencesDialog.saveValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_1, Integer.toString(this.jSplitPane1.getDividerLocation()));
  PreferencesDialog.saveValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_2, Integer.toString(this.jSplitPane2.getDividerLocation()));
}

代码示例来源:origin: magefree/mage

public Settings saveSettings() {
  Settings settings = new Settings();
  settings.maindeckSettings = deckList.saveSettings();
  settings.sideboardSetings = sideboardList.saveSettings();
  if (isLimitedBuildingOrientation) {
    dividerLocationLimited = deckAreaSplitPane.getDividerLocation();
  } else {
    dividerLocationNormal = deckAreaSplitPane.getDividerLocation();
  }
  settings.dividerLocationLimited = dividerLocationLimited;
  settings.dividerLocationNormal = dividerLocationNormal;
  return settings;
}

代码示例来源:origin: magefree/mage

private void saveDividerLocations() {
  // save panel sizes and divider locations.
  Rectangle rec = MageFrame.getDesktop().getBounds();
  String sb = Double.toString(rec.getWidth()) + 'x' + rec.getHeight();
  PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb);
  PreferencesDialog.saveValue(PreferencesDialog.KEY_TOURNAMENT_DIVIDER_LOCATION_1, Integer.toString(this.jSplitPane1.getDividerLocation()));
  PreferencesDialog.saveValue(PreferencesDialog.KEY_TOURNAMENT_DIVIDER_LOCATION_2, Integer.toString(this.jSplitPane2.getDividerLocation()));
}

代码示例来源:origin: magefree/mage

private void saveDividerLocations() {
  // save divider locations and divider saveDividerLocations
  GuiDisplayUtil.saveCurrentBoundsToPrefs();
  GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_1, this.jSplitPane1.getDividerLocation());
  GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_2, this.jSplitPaneTables.getDividerLocation());
  GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_3, chatPanelMain.getSplitDividerLocation());
}

代码示例来源:origin: magefree/mage

private void saveDividerLocationsAndDeckAreaSettings() {
  PreferencesDialog.saveValue(PreferencesDialog.KEY_EDITOR_HORIZONTAL_DIVIDER_LOCATION, Integer.toString(jSplitPane1.getDividerLocation()));
  PreferencesDialog.saveValue(PreferencesDialog.KEY_EDITOR_DECKAREA_SETTINGS, this.deckArea.saveSettings().toString());
}

代码示例来源:origin: magefree/mage

public void closeDialog() {
  if (updateTask != null) {
    updateTask.cancel(true);
  }
  this.chatPanel.disconnect();
  MageFrame.getUI().removeButton(MageComponents.TABLE_WAITING_START_BUTTON);
  this.removeDialog();
  TableUtil.saveColumnWidthAndOrderToPrefs(jTableSeats, KEY_TABLE_WAITING_COLUMNS_WIDTH, KEY_TABLE_WAITING_COLUMNS_ORDER);
  GuiDisplayUtil.saveCurrentBoundsToPrefs();
  GuiDisplayUtil.saveDividerLocationToPrefs(KEY_TABLES_DIVIDER_LOCATION_4, this.jSplitPane1.getDividerLocation());
}

代码示例来源:origin: mucommander/mucommander

/**
 * Returns width of a folders tree.
 * @return a width of a folders tree
 */
public int getTreeWidth() {
  if (!treeVisible) {
    return oldTreeWidth;
  } else {
    return treeSplitPane.getDividerLocation();
  }
}

代码示例来源:origin: openpnp/openpnp

@Override
  public void propertyChange(PropertyChangeEvent evt) {
    prefs.putInt(PREF_DIVIDER_POSITION, splitPane.getDividerLocation());
  }
});

代码示例来源:origin: openpnp/openpnp

@Override
  public void propertyChange(PropertyChangeEvent evt) {
    prefs.putInt(PREF_DIVIDER_POSITION, splitPane.getDividerLocation());
  }
});

代码示例来源:origin: openpnp/openpnp

@Override
  public void propertyChange(PropertyChangeEvent evt) {
    prefs.putInt(PREF_DIVIDER_POSITION, splitPane.getDividerLocation());
  }
});

代码示例来源:origin: openpnp/openpnp

@Override
  public void propertyChange(PropertyChangeEvent evt) {
    prefs.putInt(PREF_DIVIDER_POSITION,
        splitPaneMachineAndTabs.getDividerLocation());
  }
});

代码示例来源:origin: openpnp/openpnp

@Override
  public void propertyChange(PropertyChangeEvent evt) {
    prefs.putInt(PREF_DIVIDER_POSITION, splitPane.getDividerLocation());
  }
});

代码示例来源:origin: com.google.code.findbugs/findbugs

@Override
public void resetCommentsInputPane() {
  if (topLeftSPane != null) {
    int position = topLeftSPane.getDividerLocation();
    topLeftSPane.setRightComponent(frame.createCommentsInputPanel());
    topLeftSPane.setDividerLocation(position);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

private void displayDiffView() {
  if (splitPane != null) {
    int gg = splitPane.getDividerLocation();
    splitPane.setBottomComponent(diffView);
    splitPane.setDividerLocation(gg);
  } else {
    diffViewPanel.setComponent(diffView);
  }
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private void onWindowClosed()
{
 Dimension size = getSize();
 Preferences.userRoot().putInt(PREF_KEY_SQL_HISTORY_DLG_WIDTH, size.width);
 Preferences.userRoot().putInt(PREF_KEY_SQL_HISTORY_DLG_HEIGHT, size.height);
 Preferences.userRoot().putInt(PREF_KEY_SQL_HISTORY_DLG_DIV_LOC, splSpilt.getDividerLocation());
}

代码示例来源: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: 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);
  }
});

相关文章

JSplitPane类方法