javax.swing.JInternalFrame.getUI()方法的使用及代码示例

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

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

JInternalFrame.getUI介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

JInternalFrame mydialog = new JInternalFrame();
((BasicInternalFrameUI)mydialog.getUI()).getNorthPane().getHeight();

代码示例来源:origin: net.sf.tinylaf/tinylaf

public void propertyChange(PropertyChangeEvent evt) {
    String prop = (String)evt.getPropertyName();
    JInternalFrame f = (JInternalFrame)evt.getSource();
    TinyInternalFrameUI ui = (TinyInternalFrameUI)f.getUI();
    
    if(prop.equals("JInternalFrame.isPalette")) {
       if(evt.getNewValue() != null) {
         ui.setPalette(((Boolean)evt.getNewValue()).booleanValue());
       }
       else {
         ui.setPalette(false);
       }
     }
    
    super.propertyChange(evt);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

JInternalFrame jif= (JInternalFrame) e.getSource();
if (!(jif.getUI() instanceof InternalFrameUI))
InternalFrameUI ui= (InternalFrameUI) jif.getUI();

代码示例来源:origin: stackoverflow.com

JInternalFrame inFrame = new JInternalFrame();  
BasicInternalFrameTitlePane titlePane =  
   (BasicInternalFrameTitlePane) ((BasicInternalFrameUI) inFrame.getUI()).  
   getNorthPane();  
inFrame.remove(titlePane);

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

private void recalculateDDLFrameSize(JInternalFrame ddlFrame, JTextPane txtDDL, String[] lines)
{
 FontMetrics fm = txtDDL.getFontMetrics(txtDDL.getFont());
 int txtHeight = fm.getHeight() * lines.length;
 int txtWidht = 0;
 for (int i = 0; i < lines.length; i++)
 {
   txtWidht = Math.max(txtWidht, fm.stringWidth(lines[i]));
 }
 BasicInternalFrameUI ui = (BasicInternalFrameUI) ddlFrame.getUI();
 int titleHeight = ui.getNorthPane().getHeight();
 ddlFrame.setSize(txtWidht + 20, txtHeight + titleHeight + 20);
}

代码示例来源:origin: com.github.insubstantial/substance

/**
 * Returns the title pane of the specified root pane.
 * 
 * @param rootPane
 *            Root pane.
 * @return The title pane of the specified root pane.
 */
public static JComponent getTitlePane(JRootPane rootPane) {
  JInternalFrame jif = (JInternalFrame) SwingUtilities
      .getAncestorOfClass(JInternalFrame.class, rootPane);
  if ((jif != null) && (jif.getUI() instanceof SubstanceInternalFrameUI)) {
    SubstanceInternalFrameUI ui = (SubstanceInternalFrameUI) jif
        .getUI();
    return ui.getTitlePane();
  }
  SubstanceRootPaneUI ui = (SubstanceRootPaneUI) rootPane.getUI();
  if (ui == null)
    return null;
  return ui.getTitlePane();
}

代码示例来源:origin: stackoverflow.com

JInternalFrame[] frames = desktop.getAllFrames();
for (JInternalFrame frame: frames) {
  BasicInternalFrameUI ui = (BasicInternalFrameUI) frame.getUI();
  Component northPane = ui.getNorthPane();
  MouseMotionListener[] motionListeners = (MouseMotionListener[]) northPane.getListeners(MouseMotionListener.class);

  for (MouseMotionListener listener: motionListeners)
   northPane.removeMouseMotionListener(listener);
  }
}

代码示例来源:origin: stackoverflow.com

public static void addOnScreen(JInternalFrame inFrame, String title) {
  //border for the internal frame        

  javax.swing.plaf.InternalFrameUI ifu = inFrame.getUI();
  ((javax.swing.plaf.basic.BasicInternalFrameUI) ifu).setNorthPane(null);
  Border b1 = new LineBorder(new Color(114, 139, 173), 3, true) {
  };

  tabbedPane.setBounds(0, 0, jDesktopPane1.getWidth(), jDesktopPane1.getHeight());
  inFrame.setLocation(0, 0);
  inFrame.setSize(jDesktopPane1.getWidth(), jDesktopPane1.getHeight());
  inFrame.setBorder(b1);
  JPanel jp = new JPanel();
  jp.setLayout(new GridLayout());
  jp.setOpaque(true);
  jp.add(inFrame);
  tabbedPane.addTab(title, jp);
  tabbedPane.setSelectedComponent(jp);
  inFrame.requestFocusInWindow();
  inFrame.setVisible(true);
  tabbedPane.setVisible(true);
}

代码示例来源:origin: com.jtattoo/JTattoo

public void propertyChange(PropertyChangeEvent e) {
  JInternalFrame jif = (JInternalFrame) e.getSource();
  if (!(jif.getUI() instanceof BaseInternalFrameUI)) {
    return;
  BaseInternalFrameUI ui = (BaseInternalFrameUI) jif.getUI();
  String name = e.getPropertyName();
  if (name.equals(FRAME_TYPE)) {

代码示例来源:origin: stackoverflow.com

panel.add(new JScrollPane(toShow), BorderLayout.CENTER);
if(!(System.getProperty("os.name").startsWith("Mac OS"))){
 BasicInternalFrameUI ui = (BasicInternalFrameUI) popup.getUI();
 ui.getNorthPane().setPreferredSize(new Dimension(0,0));

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

frameHeight -= (borderInsets.top + borderInsets.bottom);
BasicInternalFrameUI frameUI = (BasicInternalFrameUI) frame.getUI();
JComponent frameTitlePane = frameUI.getNorthPane();

代码示例来源:origin: stackoverflow.com

import javax.swing.*;
import javax.swing.plaf.basic.BasicInternalFrameUI;

class A{

  public void doIt(){
    JFrame fr = new JFrame();
    fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    fr.setSize(300,300);
    JInternalFrame f = new JInternalFrame();
    f.setSize(200,200);
    fr.add(f);
    BasicInternalFrameUI ui = (BasicInternalFrameUI) f.getUI();
    ui.setNorthPane(null);
    f.setVisible(true);
    fr.setVisible(true);
  }

 public static void main(String a[]){
  A obj = new A();
  obj.doIt();
 }
}

代码示例来源:origin: org.java.net.substance/substance

/**
 * Returns the title pane of the specified root pane.
 * 
 * @param rootPane
 *            Root pane.
 * @return The title pane of the specified root pane.
 */
public static JComponent getTitlePane(JRootPane rootPane) {
  JInternalFrame jif = (JInternalFrame) SwingUtilities
      .getAncestorOfClass(JInternalFrame.class, rootPane);
  if (jif != null) {
    SubstanceInternalFrameUI ui = (SubstanceInternalFrameUI) jif
        .getUI();
    return ui.getTitlePane();
  }
  SubstanceRootPaneUI ui = (SubstanceRootPaneUI) rootPane.getUI();
  if (ui == null)
    return null;
  return ui.getTitlePane();
}

代码示例来源:origin: stackoverflow.com

internalFrame.putClientProperty("JInternalFrame.isPalette", true);
} else {
  ((BasicInternalFrameUI) internalFrame.getUI()).setNorthPane(null);

代码示例来源:origin: com.github.insubstantial/substance

private void propagateModificationState() {
  JComponent titlePane = getTitlePane();
  if (titlePane instanceof SubstanceTitlePane) {
    ((SubstanceTitlePane) titlePane)
        .getCloseButton()
        .putClientProperty(
            SubstanceLookAndFeel.WINDOW_MODIFIED,
            root
                .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED));
    return;
  }
  JInternalFrame jif = (JInternalFrame) SwingUtilities
      .getAncestorOfClass(JInternalFrame.class, this.root);
  if (jif != null) {
    SubstanceInternalFrameUI internalFrameUI = (SubstanceInternalFrameUI) jif
        .getUI();
    internalFrameUI.setWindowModified(Boolean.TRUE.equals(root
        .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED)));
  }
}

代码示例来源:origin: org.java.net.substance/substance

private void propagateModificationState() {
  JComponent titlePane = getTitlePane();
  if (titlePane instanceof SubstanceTitlePane) {
    ((SubstanceTitlePane) titlePane)
        .getCloseButton()
        .putClientProperty(
            SubstanceLookAndFeel.WINDOW_MODIFIED,
            root
                .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED));
    return;
  }
  JInternalFrame jif = (JInternalFrame) SwingUtilities
      .getAncestorOfClass(JInternalFrame.class, this.root);
  if (jif != null) {
    SubstanceInternalFrameUI internalFrameUI = (SubstanceInternalFrameUI) jif
        .getUI();
    internalFrameUI.setWindowModified(Boolean.TRUE.equals(root
        .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED)));
  }
}

代码示例来源:origin: stackoverflow.com

BasicInternalFrameUI ui = (BasicInternalFrameUI)internalFrame1.getUI();
Container north = (Container)ui.getNorthPane();
north.remove(0);
north.repaint();
for(MouseListener listener : ((javax.swing.plaf.basic.BasicInternalFrameUI) internalFrame1.getUI()).getNorthPane().getMouseListeners()){
((javax.swing.plaf.basic.BasicInternalFrameUI) internalFrame1.getUI()).getNorthPane().removeMouseListener(listener);

代码示例来源:origin: stackoverflow.com

BasicInternalFrameTitlePane titlePane = (BasicInternalFrameTitlePane) ((BasicInternalFrameUI) jInternalFrame.getUI()).getNorthPane();
jInternalFrame.remove(titlePane);

代码示例来源:origin: stackoverflow.com

BasicInternalFrameTitlePane titlePane = (BasicInternalFrameTitlePane) ((BasicInternalFrameUI) jInternalFrame.getUI()).getNorthPane();
jInternalFrame.remove(titlePane);

代码示例来源:origin: org.fudaa.framework.fudaa/fudaa-common

public void internalFrameOpened(final InternalFrameEvent _evt) {
 super.internalFrameOpened(_evt);
 if (cmdListener_ != null) {
  cmdListener_.internalFrameOpened(_evt);
 }
 final JInternalFrame frame = _evt.getInternalFrame();
 if (!BuLib.isPalette(frame)) {
  final InternalFrameUI ui = frame.getUI();
  if (ui instanceof BasicInternalFrameUI && ((BasicInternalFrameUI) ui).getNorthPane() != null) {
   ((BasicInternalFrameUI) ui).getNorthPane().add(new BuButton(BuResource.BU.getToolIcon("aide")));
   ((BasicInternalFrameUI) ui).getNorthPane().addMouseListener(new MouseAdapter() {
    public void mouseClicked(final MouseEvent _e) {
     if (SwingUtilities.isRightMouseButton(_e)) {
      final CtuluPopupMenu pop = new CtuluPopupMenu();
      pop.addMenuItem(BuResource.BU.getString("Arranger les fentres"), "RANGERFRAMES", FudaaResource.FUDAA
        .getToolIcon("arrange-frames_16.png"), true, FudaaCommonImplementation.this);
      pop.addMenuItem(BuResource.BU.getString("renommer"), "RENAMEFRAMES", BuResource.BU
        .getToolIcon("renommer"), true, new ActionListener() {
       public void actionPerformed(final ActionEvent _evtAct) {
        final Point p = _e.getComponent().getLocationOnScreen();
        FudaaCommonImplementation.this.renameInternalFrame(p.x + _e.getX(), p.y + _e.getY());
       }
      });
      pop.show(FudaaCommonImplementation.this.getCurrentInternalFrame(), _e.getX(), _e.getY());
     }
    }
   });
  }
 }
}

相关文章

JInternalFrame类方法