本文整理了Java中javax.swing.JInternalFrame.isMaximum()
方法的一些代码示例,展示了JInternalFrame.isMaximum()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JInternalFrame.isMaximum()
方法的具体详情如下:
包路径:javax.swing.JInternalFrame
类名称:JInternalFrame
方法名:isMaximum
暂无
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf
/**
* Gets the Maximum attribute of the InternalFrameWindow object
*
* @return The Maximum value
*/
public boolean isMaximum() {
return frame.isMaximum();
}
代码示例来源:origin: net.sf.tinylaf/tinylaf
public boolean isFrameMaximized() {
return frame.isMaximum();
}
代码示例来源:origin: antlr/antlrworks
public boolean isMaximized() {
return useDesktop && jInternalFrame.isMaximum();
}
代码示例来源:origin: net.sf.tinylaf/tinylaf
/**
*
* @see javax.swing.border.Border#getBorderInsets(Component)
*/
public Insets getBorderInsets(Component c) {
JInternalFrame frame = (JInternalFrame)c;
// if the frame is maximized, the border should not be visible
if(frame.isMaximum()) {
return new Insets(0, 0, 0, 0);
}
return new Insets(0,
TinyFrameBorder.FRAME_BORDER_WIDTH,
TinyFrameBorder.FRAME_BORDER_WIDTH,
TinyFrameBorder.FRAME_BORDER_WIDTH);
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
public boolean inMaximizedMode(Component comp) {
JInternalFrame internalFrame = desktopPane.getSelectedFrame();
return internalFrame != null && internalFrame.isMaximum();
}
}
代码示例来源:origin: khuxtable/seaglass
/**
* {@inheritDoc}
*/
public boolean isInState(JComponent c) {
Component parent = c;
while (parent.getParent() != null) {
if (parent instanceof RootPaneContainer) {
break;
}
parent = parent.getParent();
}
if (parent instanceof JFrame) {
return (((JFrame) parent).getExtendedState() & Frame.MAXIMIZED_BOTH) != 0;
} else if (parent instanceof JInternalFrame) {
return ((JInternalFrame) parent).isMaximum();
}
return false;
}
}
代码示例来源:origin: joel-costigliola/assertj-swing
@RunsInCurrentThread
static boolean isIconified(@Nonnull JInternalFrame frame) {
if (frame.isMaximum()) {
return false;
}
return frame.isIcon();
}
代码示例来源:origin: khuxtable/seaglass
/**
* Set the buttons' tooltip text.
*/
private void setButtonTooltips() {
if (frame.isIcon()) {
if (restoreButtonToolTip != null && restoreButtonToolTip.length() != 0) {
iconButton.setToolTipText(restoreButtonToolTip);
}
if (maxButtonToolTip != null && maxButtonToolTip.length() != 0) {
maxButton.setToolTipText(maxButtonToolTip);
}
} else if (frame.isMaximum()) {
if (iconButtonToolTip != null && iconButtonToolTip.length() != 0) {
iconButton.setToolTipText(iconButtonToolTip);
}
if (restoreButtonToolTip != null && restoreButtonToolTip.length() != 0) {
maxButton.setToolTipText(restoreButtonToolTip);
}
} else {
if (iconButtonToolTip != null && iconButtonToolTip.length() != 0) {
iconButton.setToolTipText(iconButtonToolTip);
}
if (maxButtonToolTip != null && maxButtonToolTip.length() != 0) {
maxButton.setToolTipText(maxButtonToolTip);
}
}
}
代码示例来源:origin: khuxtable/seaglass
/**
* Set the enable/disabled state for the buttons.
*/
private void enableActions() {
restoreAction.setEnabled(frame.isMaximum() || frame.isIcon());
maximizeAction.setEnabled((frame.isMaximizable() && !frame.isMaximum() && !frame.isIcon())
|| (frame.isMaximizable() && frame.isIcon()));
iconifyAction.setEnabled(frame.isIconifiable() && !frame.isIcon());
closeAction.setEnabled(frame.isClosable());
sizeAction.setEnabled(false);
moveAction.setEnabled(false);
}
代码示例来源:origin: org.jclarion/clarion-runtime
@Override
public Dimension getPreferredSize()
{
int w=50;
int h=50;
for ( Component c : getComponents() ) {
if (!c.isVisible()) continue;
if (c instanceof JComponent) {
if (((JComponent)c).getClientProperty("shadow")!=null) continue;
}
if (c instanceof JInternalFrame) {
if (((JInternalFrame)c).isMaximum()) continue;
}
int nw = c.getX()+c.getWidth();
if (nw>w) w=nw;
int nh = c.getY()+c.getHeight();
if (nh>h) h=nh;
}
return new Dimension(w,h);
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = IS_MAXIMIZED_JSDOC)
public boolean getMaximized() {
if (surface != null) {
if (surface instanceof JInternalFrame) {
JInternalFrame aFrame = (JInternalFrame) surface;
return aFrame.isMaximum() && !aFrame.isIcon();
} else if (surface instanceof JFrame) {
JFrame aFrame = (JFrame) surface;
return aFrame.getExtendedState() == JFrame.MAXIMIZED_BOTH;
}
}
return false;
}
代码示例来源:origin: khuxtable/seaglass
/**
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent evt) {
if (frame.isMaximizable()) {
if (frame.isMaximum() && frame.isIcon()) {
try {
frame.setIcon(false);
} catch (PropertyVetoException e) {
}
} else if (!frame.isMaximum()) {
try {
frame.setMaximum(true);
} catch (PropertyVetoException e) {
}
} else {
try {
frame.setMaximum(false);
} catch (PropertyVetoException e) {
}
}
}
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = RESTORE_ALL_JSDOC)
public void restoreAll() throws PropertyVetoException {
for (JInternalFrame f : getAllFrames()) {
if (f.isIcon()) {
f.setIcon(false);
}
if (f.isMaximum()) {
f.setMaximum(false);
}
}
}
代码示例来源:origin: khuxtable/seaglass
/**
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent evt) {
if (frame.isMaximizable() && frame.isMaximum() && frame.isIcon()) {
try {
frame.setIcon(false);
} catch (PropertyVetoException e) {
}
} else if (frame.isMaximizable() && frame.isMaximum()) {
try {
frame.setMaximum(false);
} catch (PropertyVetoException e) {
}
} else if (frame.isIconifiable() && frame.isIcon()) {
try {
frame.setIcon(false);
} catch (PropertyVetoException e) {
}
}
}
}
代码示例来源:origin: khuxtable/seaglass
public void componentResized(ComponentEvent e) {
if (frame != null && frame.isMaximum()) {
JDesktopPane desktop = (JDesktopPane) e.getSource();
for (Component comp : desktop.getComponents()) {
if (comp instanceof SeaGlassDesktopPaneUI.TaskBar) {
frame.setBounds(0, 0, desktop.getWidth(), desktop.getHeight() - comp.getHeight());
frame.revalidate();
break;
}
}
}
// Update the new parent bounds for next resize, but don't
// let the super method touch this frame
JInternalFrame f = frame;
frame = null;
super.componentResized(e);
frame = f;
}
};
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = MINIMIZE_JSDOC)
public void minimize() {
if (surface != null) {
if (surface instanceof JFrame) {
((JFrame) surface).setExtendedState(JFrame.ICONIFIED);
} else if (surface instanceof JInternalFrame) {
JInternalFrame aFrame = (JInternalFrame) surface;
try {
if (aFrame.isMaximum()) {
aFrame.setMaximum(false);
}
if (!aFrame.isIcon() && aFrame.isIconifiable()) {
aFrame.setIcon(true);
}
} catch (Exception e) {
}
}
}
}
代码示例来源:origin: org.jclarion/clarion-runtime
@Override
public void notifySized()
{
if (suppressWindowSizingEvents) return;
Container win = getWindow();
if (win==null) return;
int max=0;
if (win instanceof JFrame) {
max = (((JFrame)win).getExtendedState()&JFrame.MAXIMIZED_BOTH)!=0?1:0;
}
if (win instanceof JInternalFrame) {
max = ((JInternalFrame)win).isMaximum()?1:0;
}
Insets i = getInsets();
int w = widthPixelsToDialog(win.getWidth()- ((i==null) ? 0 : i.left + i.right));
int h=heightPixelsToDialog(win.getHeight()- ((i==null) ? 0 : i.top + i.bottom));
if ( w==lastWidth && h==lastHeight && max==lastMax) return;
lastWidth=w;
lastHeight=h;
lastMax=max;
ClarionEvent ce = new ClarionEvent(Event.SIZED,null,false);
ce.setAdditionalData(w,h,max);
post(ce);
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = MAXIMIZE_JSDOC)
public void maximize() {
if (surface != null) {
if (surface instanceof JFrame) {
((JFrame) surface).setExtendedState(JFrame.MAXIMIZED_BOTH);
} else if (surface instanceof JInternalFrame) {
JInternalFrame aFrame = (JInternalFrame) surface;
try {
if (aFrame.isIcon()) {
aFrame.setIcon(false);
}
if (!aFrame.isMaximum() && aFrame.isMaximizable()) {
aFrame.setMaximum(true);
aFrame.toFront();
}
} catch (Exception e) {
}
}
}
}
private static final String RESTORE_JSDOC = ""
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = RESTORE_JSDOC)
public void restore() {
if (surface != null) {
if (surface instanceof JInternalFrame) {
JInternalFrame aFrame = (JInternalFrame) surface;
try {
if (aFrame.isMaximum()) {
aFrame.setMaximum(false);
}
if (aFrame.isIcon()) {
aFrame.setIcon(false);
}
} catch (Exception e) {
}
aFrame.toFront();
} else if (surface instanceof JFrame) {
((JFrame) surface).setExtendedState(JFrame.NORMAL);
((JFrame) surface).toFront();
}
}
}
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
public void deiconifyFrame(JInternalFrame f) {
JInternalFrame.JDesktopIcon desktopIcon = f.getDesktopIcon();
Container c = desktopIcon.getParent();
if (c != null) {
c.add(f);
// If the frame is to be restored to a maximized state make
// sure it still fills the whole desktop.
if (f.isMaximum()) {
Rectangle desktopBounds = c.getBounds();
if (f.getWidth() != desktopBounds.width ||
f.getHeight() != desktopBounds.height) {
setBoundsForFrame(f, 0, 0,
desktopBounds.width, desktopBounds.height);
}
}
removeIconFor(f);
if (f.isSelected()) {
f.moveToFront();
} else {
try {
f.setSelected(true);
} catch (PropertyVetoException e2) {
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!