本文整理了Java中javax.swing.JSplitPane.resetToPreferredSizes()
方法的一些代码示例,展示了JSplitPane.resetToPreferredSizes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSplitPane.resetToPreferredSizes()
方法的具体详情如下:
包路径:javax.swing.JSplitPane
类名称:JSplitPane
方法名:resetToPreferredSizes
暂无
代码示例来源:origin: magefree/mage
@Override
public void actionPerformed(ActionEvent actionEvent) {
imagePanelState = !imagePanelState;
if (!imagePanelState) {
jSplitPane0.resetToPreferredSizes();
jSplitPane0.setDividerLocation(jSplitPane0.getSize().width - jSplitPane0.getInsets().right - jSplitPane0.getDividerSize() - 260);
} else {
jSplitPane0.setDividerLocation(1.0);
}
}
});
代码示例来源:origin: org.openspml/openspml
public void resizeSplit() {
// will revalidate and move the split bar
// I would imagine this works as long as the panel
// isn't in a JScrollPane
_split.resetToPreferredSizes();
}
代码示例来源:origin: org.scijava/scijava-ui-swing
public void setSourcesPanelVisible(boolean visible) {
if (visible) {
reloadSources();
splitPane.setResizeWeight(0.2);
splitPane.resetToPreferredSizes();
}
else {
splitPane.setResizeWeight(0.0);
splitPane.setDividerLocation(0);
}
}
代码示例来源:origin: de.richtercloud/flexdock-core
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)
&& e.getClickCount() == 2) {
// TODO should be not override, but placed logic here
((JSplitPane) divider.getParent())
.resetToPreferredSizes();
}
}
});
代码示例来源:origin: uk.ac.ebi.pride.toolsuite/inspector-swing-utils
visibleContainerComponent = null;
centralSplitPane.resetToPreferredSizes();
代码示例来源:origin: uk.ac.ebi.pride/pride-utilities
visibleContainerComponent = null;
centralSplitPane.resetToPreferredSizes();
代码示例来源:origin: MegaMek/mekhq
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
if ((splitPersonnel.getSize().width
- splitPersonnel.getDividerLocation() + splitPersonnel
.getDividerSize()) < PersonnelTab.PERSONNEL_VIEW_WIDTH) {
// expand
splitPersonnel.resetToPreferredSizes();
} else {
// collapse
splitPersonnel.setDividerLocation(1.0);
}
}
}
});
代码示例来源:origin: MegaMek/mekhq
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
if ((splitUnit.getSize().width - splitUnit.getDividerLocation() + splitUnit
.getDividerSize()) < HangarTab.UNIT_VIEW_WIDTH) {
// expand
splitUnit.resetToPreferredSizes();
} else {
// collapse
splitUnit.setDividerLocation(1.0);
}
}
}
});
代码示例来源:origin: MegaMek/mekhq
@Subscribe
public void handle(OptionsChangedEvent ev) {
splitScenario.getBottomComponent().setVisible(getCampaignOptions().getUseAtB());
splitScenario.resetToPreferredSizes();
}
代码示例来源:origin: MegaMek/mekhq
public void focusOnUnit(UUID id) {
HangarTab ht = (HangarTab)getTab(GuiTabType.HANGAR);
if (null == id || null == ht) {
return;
}
if (mainPanel.getDividerLocation() < 700) {
if (mainPanel.getLastDividerLocation() > 700) {
mainPanel
.setDividerLocation(mainPanel.getLastDividerLocation());
} else {
mainPanel.resetToPreferredSizes();
}
}
ht.focusOnUnit(id);
tabMain.setSelectedIndex(getTabIndexByName(resourceMap
.getString("panHangar.TabConstraints.tabTitle")));
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
/**
* Overridden to handle our layout requirements
*/
public void doLayout() {
Component[] c = getComponents();
if (c.length > 0 && getWidth() >= 0 && getHeight() >= 0) {
Insets ins = getInsets();
c[0].setBounds(ins.left, ins.top, getWidth() - (ins.right + ins.left), getHeight() - ins.top + ins.bottom);
if (c[0] instanceof JSplitPane && Boolean.TRUE.equals(firstSplit)) {
JSplitPane pane = (JSplitPane) c[0];
pane.setDividerLocation(0.80f);
pane.resetToPreferredSizes();
JComponent dc = findDescriptionComponent();
if (dc != null) {
if (dc.getHeight() > 0) {
firstSplit = Boolean.FALSE;
}
} else {
firstSplit = Boolean.FALSE;
}
}
if (c.length > 1) {
throw new IllegalStateException("Hmm, something is wrong: " + Arrays.asList(c));
}
}
}
代码示例来源:origin: uk.ac.ebi.pride/pride-utilities
centralSplitPane.resetToPreferredSizes();
代码示例来源:origin: uk.ac.ebi.pride.toolsuite/inspector-swing-utils
centralSplitPane.resetToPreferredSizes();
代码示例来源:origin: MegaMek/mekhq
public void focusOnUnit(UUID id) {
splitUnit.resetToPreferredSizes();
int row = -1;
for (int i = 0; i < unitTable.getRowCount(); i++) {
if (unitModel.getUnit(unitTable.convertRowIndexToModel(i)).getId().equals(id)) {
row = i;
break;
}
}
if (row == -1) {
// try expanding the filter to all units
choiceUnit.setSelectedIndex(0);
for (int i = 0; i < unitTable.getRowCount(); i++) {
if (unitModel.getUnit(unitTable.convertRowIndexToModel(i)).getId().equals(id)) {
row = i;
break;
}
}
}
if (row != -1) {
unitTable.setRowSelectionInterval(row, row);
unitTable.scrollRectToVisible(unitTable.getCellRect(row, 0, true));
}
}
代码示例来源:origin: MegaMek/mekhq
public void focusOnPerson(UUID id) {
splitPersonnel.resetToPreferredSizes();
int row = -1;
for (int i = 0; i < personnelTable.getRowCount(); i++) {
if (personModel.getPerson(personnelTable.convertRowIndexToModel(i)).getId().equals(id)) {
row = i;
break;
}
}
if (row == -1) {
// try expanding the filter to all units
choicePerson.setSelectedIndex(0);
for (int i = 0; i < personnelTable.getRowCount(); i++) {
if (personModel.getPerson(personnelTable.convertRowIndexToModel(i)).getId().equals(id)) {
row = i;
break;
}
}
}
if (row != -1) {
personnelTable.setRowSelectionInterval(row, row);
personnelTable.scrollRectToVisible(personnelTable.getCellRect(row, 0, true));
}
}
代码示例来源:origin: MegaMek/mekhq
public void focusOnPerson(UUID id) {
if (null == id) {
return;
}
PersonnelTab pt = (PersonnelTab)getTab(GuiTabType.PERSONNEL);
if (pt == null) {
return;
}
if (mainPanel.getDividerLocation() < 700) {
if (mainPanel.getLastDividerLocation() > 700) {
mainPanel
.setDividerLocation(mainPanel.getLastDividerLocation());
} else {
mainPanel.resetToPreferredSizes();
}
}
pt.focusOnPerson(id);
tabMain.setSelectedComponent(pt);
}
代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking
/** Resest recursively the left and right components to their preferred size
* if possible. (same contract as JSplitPane's).
* <p>
* If contained components are SplitContainers, their are also reset to their
* preferredSize.
* */
public void resetToPreferredSizes() {
super.resetToPreferredSizes();
if(getLeftComponent() instanceof SplitContainer) {
((SplitContainer) getLeftComponent()).resetToPreferredSizes();
}
if(getRightComponent() instanceof SplitContainer) {
((SplitContainer) getRightComponent()).resetToPreferredSizes();
}
}
代码示例来源:origin: MegaMek/mekhq
public void focusOnUnitInRepairBay(UUID id) {
if (null == id) {
return;
}
if (getTab(GuiTabType.REPAIR) != null) {
if (mainPanel.getDividerLocation() < 700) {
if (mainPanel.getLastDividerLocation() > 700) {
mainPanel
.setDividerLocation(mainPanel.getLastDividerLocation());
} else {
mainPanel.resetToPreferredSizes();
}
}
((RepairTab)getTab(GuiTabType.REPAIR)).focusOnUnit(id);
tabMain.setSelectedComponent(getTab(GuiTabType.REPAIR));
}
}
代码示例来源:origin: triplea-game/triplea
gameCenterPanel.setResizeWeight(1.0);
gameMainPanel.add(gameCenterPanel, BorderLayout.CENTER);
gameCenterPanel.resetToPreferredSizes();
内容来源于网络,如有侵权,请联系作者删除!