类javax.swing.JLayeredPane源码实例Demo

下面列出了怎么用javax.swing.JLayeredPane的API类实例代码及写法,或者点击链接到github查看源代码。

private Constructor dataModelViewConstructorFactory(String dataModelViewClassName) {
    Constructor<?> dataModelViewConstructor = null;

    try {
        Class<?> dataModelViewClass = Class.forName(dataModelViewClassName);
        Class<?>[] partypes = new Class[5];
        partypes[0] = JLayeredPane.class;
        partypes[1] = TripoliFraction.class;
        partypes[2] = DataModelInterface.class;
        partypes[3] = Rectangle.class;
        partypes[4] = boolean.class;
        dataModelViewConstructor = dataModelViewClass.getConstructor(partypes);
    } catch (ClassNotFoundException | NoSuchMethodException | SecurityException classNotFoundException) {
    }

    return dataModelViewConstructor;
}
 
/**
 *
 * @param sampleSessionDataView
 * @param rawRatioDataModel
 * @param targetDataModelView
 * @param bounds
 * @param forStandards
 * @param meanOnly the value of meanOnly
 */
public InterceptFitFunctionsPresentationView( //
        JLayeredPane sampleSessionDataView, //
        DataModelInterface rawRatioDataModel, //
        FitFunctionDataInterface targetDataModelView, //
        Rectangle bounds, //
        boolean forStandards, //
        boolean meanOnly) {

    super(targetDataModelView, bounds);

    setCursor(Cursor.getDefaultCursor());

    this.sampleSessionDataView = sampleSessionDataView;
    this.rawRatioDataModel = rawRatioDataModel;
    this.forStandards = forStandards;
    this.meanOnly = meanOnly;
}
 
/**
 *
 * @param sampleSessionDataView
 * @param tripoliFraction
 * @param rawRatioDataModel
 * @param bounds
 * @param invokeMouseListener
 */
public FitFunctionsOnDownHoleRatioDataView(//
        JLayeredPane sampleSessionDataView, //
        TripoliFraction tripoliFraction,//
        DataModelInterface rawRatioDataModel,//
        Rectangle bounds,//
        boolean invokeMouseListener) {
    super(sampleSessionDataView, tripoliFraction, bounds, invokeMouseListener, true);

    this.rawRatioDataModel = rawRatioDataModel;
    this.fittedFunctionValues = null;
    this.showFittedFunction = false;

    this.standardValue = rawRatioDataModel.getStandardValue();

    this.dataPresentationMode = DataPresentationModeEnum.LOGRATIO;
}
 
源代码4 项目: ET_Redux   文件: AgePickDemo.java
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings ("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLayeredPane1 = new javax.swing.JLayeredPane();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jLayeredPane1.setBackground(new java.awt.Color(255, 255, 255));
    jLayeredPane1.setOpaque(true);

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
        .add(jLayeredPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1171, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
        .add(jLayeredPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE)
    );

    pack();
}
 
源代码5 项目: beautyeye   文件: BERootPaneUI.java
/**
 * Sets the window title pane -- the JComponent used to provide a plaf a
 * way to override the native operating system's window title pane with
 * one whose look and feel are controlled by the plaf.  The plaf creates
 * and sets this value; the default is null, implying a native operating
 * system window title pane.
 *
 * @param root the root
 * @param titlePane the title pane
 */
private void setTitlePane(JRootPane root, JComponent titlePane) 
{
	JLayeredPane layeredPane = root.getLayeredPane();
	JComponent oldTitlePane = getTitlePane();

	if (oldTitlePane != null)
	{
		oldTitlePane.setVisible(false);
		layeredPane.remove(oldTitlePane);
	}
	if (titlePane != null) 
	{
		layeredPane.add(titlePane, JLayeredPane.FRAME_CONTENT_LAYER);
		titlePane.setVisible(true);
	}
	this.titlePane = titlePane;
}
 
源代码6 项目: netbeans   文件: SlideOperationImpl.java
private void performOperation(JLayeredPane pane, Integer layer) {
    // XXX - TBD
    switch (type) {
        case SLIDE_IN:
            component.setBounds(finishBounds);
            pane.add(component, layer);
            if( isHeavyWeightShowing() ) {
                repaintLayeredPane();
            }
            break;
        case SLIDE_OUT:
            pane.remove(component);
            break;
        case SLIDE_RESIZE:
            component.setBounds(finishBounds);
            ((JComponent)component).revalidate();
            if( isHeavyWeightShowing() ) {
                repaintLayeredPane();
            }
            break;
    }
}
 
源代码7 项目: ET_Redux   文件: DataViewsOverlay.java
/**
 *
 *
 * @param tripoliFractionRawDataModelViews
 * @param sampleSessionDataView
 * @param dataPresentationMode the value of dataPresentationMode
 * @param bounds
 */
public DataViewsOverlay(//
        AbstractRawDataView[] tripoliFractionRawDataModelViews, //
        JLayeredPane sampleSessionDataView, //
        DataPresentationModeEnum dataPresentationMode,//
        Rectangle bounds) {
    super(bounds);

    this.tripoliFractionRawDataModelViews = tripoliFractionRawDataModelViews;
    this.sampleSessionDataView = sampleSessionDataView;
    this.downholeFractionationDataModel = null;
    this.myFittedAverages = null;
    this.dataPresentationMode = dataPresentationMode;

    this.standardValue = tripoliFractionRawDataModelViews[0].getStandardValue();

    addMeAsMouseListener();

}
 
源代码8 项目: RipplePower   文件: LightBoxPanel.java
public void close() {

		Preconditions.checkState(SwingUtilities.isEventDispatchThread(), "Must be on the EDT");
		JLayeredPane layeredPane = Panels.getApplication().getLayeredPane();

		Component[] components = layeredPane.getComponents();

		if (components.length == 4 || components.length == 6) {
			layeredPane.remove(0);
		}

		if (components.length > 2 && components.length < 7) {
			layeredPane.remove(1);
			layeredPane.remove(0);
		}
		Panels.getApplication().validate();
		Panels.getApplication().repaint();

	}
 
源代码9 项目: ET_Redux   文件: AbstractRawDataView.java
/**
 *
 *
 * @param sampleSessionDataView
 * @param tripoliFraction
 * @param bounds
 * @param invokeMouseListener
 * @param forStandards the value of forStandards
 */
public AbstractRawDataView(//
        JLayeredPane sampleSessionDataView, //
        TripoliFraction tripoliFraction, //
        Rectangle bounds, //
        boolean invokeMouseListener,//
        boolean forStandards) {
    this(bounds);

    this.sampleSessionDataView = sampleSessionDataView;
    this.tripoliFraction = tripoliFraction;
    this.forStandards = forStandards;

    if (tripoliFraction != null) {
        if (!tripoliFraction.isStandard()) {
            setBackground(ReduxConstants.LightBlueForUnknowns);
        }
    }

    if (invokeMouseListener) {
        addMeAsMouseListener();
    }

}
 
源代码10 项目: netbeans   文件: ComponentPeer.java
private int[] computeVisibleSpan() {
    Component parent = pane.getParent();
    
    if (parent instanceof JLayeredPane) {
        parent = parent.getParent();
    }

    if (parent instanceof JViewport) {
        JViewport vp = (JViewport) parent;

        Point start = vp.getViewPosition();
        Dimension size = vp.getExtentSize();
        Point end = new Point((int) (start.getX() + size.getWidth()), (int) (start.getY() + size.getHeight()));

        int startPosition = pane.viewToModel(start);
        int endPosition = pane.viewToModel(end);

        if (parentWithListener != vp) {
            vp.addChangeListener(WeakListeners.change(this, vp));
            parentWithListener = vp;
        }
        return new int[] {startPosition, endPosition};
    }

    return new int[] {0, pane.getDocument().getLength()};
}
 
@Override
public Component add(Component comp) {
    setsize(comp.getPreferredSize());
    Component[] comps = getComponents();
    if (comps.length > 0) {
        oldComponent = comps[0];
    }
    if (comp.equals(oldComponent)) {
        return super.add(comp);
    }
    if (oldComponent != null) {
        putLayer((JComponent) oldComponent, JLayeredPane.DEFAULT_LAYER);
    }
    Component returnResult = super.add(comp);
    putLayer((JComponent) comp, JLayeredPane.DRAG_LAYER);
    comp.setSize(getPreferredSize());
    comp.setVisible(true);
    comp.setLocation(0, 0 - getPreferredSize().height);
    slideFromTop(comp, oldComponent);
    return returnResult;
}
 
源代码12 项目: dragonwell8_jdk   文件: MetaData.java
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    // Ignore the children of a JScrollPane.
    // Pending(milne) find a better way to do this.
    if (oldInstance instanceof javax.swing.JScrollPane) {
        return;
    }
    java.awt.Container oldC = (java.awt.Container)oldInstance;
    java.awt.Component[] oldChildren = oldC.getComponents();
    java.awt.Container newC = (java.awt.Container)newInstance;
    java.awt.Component[] newChildren = (newC == null) ? new java.awt.Component[0] : newC.getComponents();

    BorderLayout layout = ( oldC.getLayout() instanceof BorderLayout )
            ? ( BorderLayout )oldC.getLayout()
            : null;

    JLayeredPane oldLayeredPane = (oldInstance instanceof JLayeredPane)
            ? (JLayeredPane) oldInstance
            : null;

    // Pending. Assume all the new children are unaltered.
    for(int i = newChildren.length; i < oldChildren.length; i++) {
        Object[] args = ( layout != null )
                ? new Object[] {oldChildren[i], layout.getConstraints( oldChildren[i] )}
                : (oldLayeredPane != null)
                        ? new Object[] {oldChildren[i], oldLayeredPane.getLayer(oldChildren[i]), Integer.valueOf(-1)}
                        : new Object[] {oldChildren[i]};

        invokeStatement(oldInstance, "add", args, out);
    }
}
 
/**
 *
 * @param sampleSessionDataView
 * @param downholeFractionationDataModel
 * @param targetDataModelView
 * @param bounds
 */
public DownholeFitFunctionsPresentationView( //
        JLayeredPane sampleSessionDataView, //
        DataModelFitFunctionInterface downholeFractionationDataModel,//
        FitFunctionDataInterface targetDataModelView,
        Rectangle bounds) {

    super(targetDataModelView, bounds);

    setCursor(Cursor.getDefaultCursor());

    this.sampleSessionDataView = sampleSessionDataView;
    this.downholeFractionationDataModel = downholeFractionationDataModel;
}
 
源代码14 项目: gcs   文件: Search.java
@Override
public void focusGained(FocusEvent event) {
    if (mFloater == null) {
        Point where = new Point(0, mFilterField.getHeight() + 1);
        mFloater = new SearchDropDown(mTarget.getSearchRenderer(), mFilterField, mTarget);
        JLayeredPane layeredPane = getRootPane().getLayeredPane();
        UIUtilities.convertPoint(where, mFilterField, layeredPane);
        layeredPane.add(mFloater, JLayeredPane.POPUP_LAYER);
        mFloater.repaint();
        adjustHits();
    }
}
 
源代码15 项目: ET_Redux   文件: YAxisView.java
/**
 *
 *
 * @param rawDataModelViews
 * @param sampleSessionDataView
 * @param backgroundColor
 * @param minY
 * @param maxY
 * @param bounds
 * @param floating
 * @param forStandards the value of forStandards
 */
public YAxisView(//
        AbstractRawDataView[] rawDataModelViews, //
        JLayeredPane sampleSessionDataView, //
        Color backgroundColor, //
        double minY, //
        double maxY, //
        Rectangle bounds, //
        boolean floating, //
        boolean forStandards) {
    super(bounds);

    this.rawDataModelViews = rawDataModelViews;
    this.dataViewsOverlay = null;
    this.sampleSessionDataView = sampleSessionDataView;
    this.backgroundColor = backgroundColor;
    this.yOnMousePress = 0;
    this.minY = minY;
    this.maxY = maxY;
    this.floating = floating;
    this.forStandards = forStandards;

    // horizontal layout arbitrarily fixed
    this.minX = 0;
    this.maxX = bounds.getWidth();//100;

    setOpaque(true);
    setBackground(Color.white);

    setBounds(bounds);
    graphWidth = bounds.width - leftMargin;
    graphHeight = bounds.height - topMargin;

    addMeAsMouseListener();
    addMeAsMouseMotionListener();

    setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
 
private JLayeredPane shadeFactory(JLayeredPane sampleSessionDataView) {
    AbstractRawDataView maskingShadeControl = //
            new MaskingShadeControl(new Rectangle(15, 88, 170, 20), myOnPeakNormalizedAquireTimes, sampleSessionDataView);

    maskingShadeControl.preparePanel(true, false);

    return maskingShadeControl;
}
 
源代码17 项目: ET_Redux   文件: KwikiDateModesSelectorPanel.java
/**
 * 
 * @param enableThPa
 */
public void SetupDateCorrectionCheckBoxes ( boolean enableThPa ) {

    ActionListener dateCorrectionChkBoxActionListener = new ActionListener() {

        public void actionPerformed ( ActionEvent e ) {
            AbstractButton abstractButton =
                    (AbstractButton) e.getSource();
            String choice = abstractButton.getActionCommand();
            CalculateDateCorrectionMode( choice );
        }
    };

    correctTh = new JCheckBox( "Th" );
    correctTh.setActionCommand( "Th" );
    correctTh.setOpaque( false );
    correctTh.setForeground( new java.awt.Color( 204, 0, 0 ) );
    correctTh.setFont( new Font( "SansSerif", Font.BOLD, 9 ) );
    correctTh.setBounds( 125, 20, 45, 15 );
    correctTh.setEnabled( enableThPa );
    correctTh.addActionListener( dateCorrectionChkBoxActionListener );
    add( correctTh, javax.swing.JLayeredPane.DEFAULT_LAYER );

    correctPa = new JCheckBox( "Pa" );
    correctPa.setActionCommand( "Pa" );
    correctPa.setOpaque( false );
    correctPa.setForeground( new java.awt.Color( 204, 0, 0 ) );
    correctPa.setFont( new Font( "SansSerif", Font.BOLD, 9 ) );
    correctPa.setBounds( 125, 40, 45, 15 );
    correctPa.setEnabled( enableThPa );
    correctPa.addActionListener( dateCorrectionChkBoxActionListener );
    add( correctPa, javax.swing.JLayeredPane.DEFAULT_LAYER );
}
 
源代码18 项目: openjdk-jdk9   文件: CursorOverlappedPanelsTest.java
private static void createAndShowGUI() {
    final JFrame frame = new JFrame("Test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JLayeredPane layeredPane = new JLayeredPane();
    layeredPane.setPreferredSize(new Dimension(400, 400));
    JPanel enabledPanel = createPanel(new Point(10, 10), true);
    JPanel disabledPanel = createPanel(new Point(100, 100), false);
    layeredPane.add(disabledPanel, JLayeredPane.PALETTE_LAYER);
    layeredPane.add(enabledPanel, JLayeredPane.DEFAULT_LAYER);

    frame.getContentPane().add(layeredPane);
    frame.pack();
    frame.setVisible(true);
}
 
源代码19 项目: jdk8u-jdk   文件: MetaData.java
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    // Ignore the children of a JScrollPane.
    // Pending(milne) find a better way to do this.
    if (oldInstance instanceof javax.swing.JScrollPane) {
        return;
    }
    java.awt.Container oldC = (java.awt.Container)oldInstance;
    java.awt.Component[] oldChildren = oldC.getComponents();
    java.awt.Container newC = (java.awt.Container)newInstance;
    java.awt.Component[] newChildren = (newC == null) ? new java.awt.Component[0] : newC.getComponents();

    BorderLayout layout = ( oldC.getLayout() instanceof BorderLayout )
            ? ( BorderLayout )oldC.getLayout()
            : null;

    JLayeredPane oldLayeredPane = (oldInstance instanceof JLayeredPane)
            ? (JLayeredPane) oldInstance
            : null;

    // Pending. Assume all the new children are unaltered.
    for(int i = newChildren.length; i < oldChildren.length; i++) {
        Object[] args = ( layout != null )
                ? new Object[] {oldChildren[i], layout.getConstraints( oldChildren[i] )}
                : (oldLayeredPane != null)
                        ? new Object[] {oldChildren[i], oldLayeredPane.getLayer(oldChildren[i]), Integer.valueOf(-1)}
                        : new Object[] {oldChildren[i]};

        invokeStatement(oldInstance, "add", args, out);
    }
}
 
源代码20 项目: xdm   文件: XDMFrame.java
public XDMFrame() {
		setUndecorated(true);
//		getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
//		setDefaultLookAndFeelDecorated(true);

//		

		createCursors();
		contentPane = new JPanel(new BorderLayout());
		modalPane = new LayeredPanel(150);
		modalPane.setVisible(false);
		dialogPane = new LayeredPanel(40);
		dialogPane.setVisible(false);
		createResizeGrip();

		panTitle = new TitlePanel(new BorderLayout(), this);
		panTitle.setBackground(ColorResource.getTitleColor());
		panTitle.setBorder(new EmptyBorder(XDMUtils.getScaledInt(5), XDMUtils.getScaledInt(5), XDMUtils.getScaledInt(0),
				XDMUtils.getScaledInt(5)));
		panTitle.setOpaque(true);

		panClient = new JPanel(new BorderLayout());
		panClient.setBackground(Color.WHITE);
		JPanel panContent = new JPanel(new BorderLayout());
		panContent.add(panTitle, BorderLayout.NORTH);
		panContent.add(panClient);
		contentPane.add(panContent);
		layeredPane = new JLayeredPane();
		layeredPane.add(contentPane, Integer.valueOf(DEFAULT_LAYER));
		layeredPane.add(modalPane, Integer.valueOf(MODAL_LAYER));
		layeredPane.add(dialogPane, Integer.valueOf(DIALOG_LAYER));
		super.add(layeredPane);
		super.addComponentListener(this);
	}
 
源代码21 项目: jdk8u60   文件: MetaData.java
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    // Ignore the children of a JScrollPane.
    // Pending(milne) find a better way to do this.
    if (oldInstance instanceof javax.swing.JScrollPane) {
        return;
    }
    java.awt.Container oldC = (java.awt.Container)oldInstance;
    java.awt.Component[] oldChildren = oldC.getComponents();
    java.awt.Container newC = (java.awt.Container)newInstance;
    java.awt.Component[] newChildren = (newC == null) ? new java.awt.Component[0] : newC.getComponents();

    BorderLayout layout = ( oldC.getLayout() instanceof BorderLayout )
            ? ( BorderLayout )oldC.getLayout()
            : null;

    JLayeredPane oldLayeredPane = (oldInstance instanceof JLayeredPane)
            ? (JLayeredPane) oldInstance
            : null;

    // Pending. Assume all the new children are unaltered.
    for(int i = newChildren.length; i < oldChildren.length; i++) {
        Object[] args = ( layout != null )
                ? new Object[] {oldChildren[i], layout.getConstraints( oldChildren[i] )}
                : (oldLayeredPane != null)
                        ? new Object[] {oldChildren[i], oldLayeredPane.getLayer(oldChildren[i]), Integer.valueOf(-1)}
                        : new Object[] {oldChildren[i]};

        invokeStatement(oldInstance, "add", args, out);
    }
}
 
源代码22 项目: arcgis-runtime-demo-java   文件: GeoJsonApp.java
/**
 * Creates a content pane.
 * 
 * @return a content pane.
 */
private static JLayeredPane createContentPane() {
  JLayeredPane contentPane = new JLayeredPane();
  contentPane.setBounds(100, 100, 1000, 700);
  contentPane.setLayout(new BorderLayout(0, 0));
  contentPane.setVisible(true);
  return contentPane;
}
 
源代码23 项目: freecol   文件: Canvas.java
/**
 * Adds a component to this Canvas updating the menus.
 *
 * Make sure the status panel is not present unless the component
 * *is* the status panel.
 *
 * @param comp The {@code Component} to add to this canvas.
 * @param i The layer to add the component to (see JLayeredPane).
 */
private void addToCanvas(Component comp, Integer i) {
    if (statusPanel.isVisible()) {
        if (comp == statusPanel) return;
        if (!(comp instanceof JMenuItem)) removeFromCanvas(statusPanel);
    }

    if (i == null) i = JLayeredPane.DEFAULT_LAYER;
    try {
        super.add(comp, i);
    } catch (Exception e) {
        logger.log(Level.WARNING, "addToCanvas(" + comp + ", " + i
            + ") failed.", e);
    }
}
 
源代码24 项目: jdk8u60   文件: javax_swing_JLayeredPane.java
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}
 
源代码25 项目: hottub   文件: MetaData.java
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    // Ignore the children of a JScrollPane.
    // Pending(milne) find a better way to do this.
    if (oldInstance instanceof javax.swing.JScrollPane) {
        return;
    }
    java.awt.Container oldC = (java.awt.Container)oldInstance;
    java.awt.Component[] oldChildren = oldC.getComponents();
    java.awt.Container newC = (java.awt.Container)newInstance;
    java.awt.Component[] newChildren = (newC == null) ? new java.awt.Component[0] : newC.getComponents();

    BorderLayout layout = ( oldC.getLayout() instanceof BorderLayout )
            ? ( BorderLayout )oldC.getLayout()
            : null;

    JLayeredPane oldLayeredPane = (oldInstance instanceof JLayeredPane)
            ? (JLayeredPane) oldInstance
            : null;

    // Pending. Assume all the new children are unaltered.
    for(int i = newChildren.length; i < oldChildren.length; i++) {
        Object[] args = ( layout != null )
                ? new Object[] {oldChildren[i], layout.getConstraints( oldChildren[i] )}
                : (oldLayeredPane != null)
                        ? new Object[] {oldChildren[i], oldLayeredPane.getLayer(oldChildren[i]), Integer.valueOf(-1)}
                        : new Object[] {oldChildren[i]};

        invokeStatement(oldInstance, "add", args, out);
    }
}
 
源代码26 项目: openjdk-jdk8u   文件: MetaData.java
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    // Ignore the children of a JScrollPane.
    // Pending(milne) find a better way to do this.
    if (oldInstance instanceof javax.swing.JScrollPane) {
        return;
    }
    java.awt.Container oldC = (java.awt.Container)oldInstance;
    java.awt.Component[] oldChildren = oldC.getComponents();
    java.awt.Container newC = (java.awt.Container)newInstance;
    java.awt.Component[] newChildren = (newC == null) ? new java.awt.Component[0] : newC.getComponents();

    BorderLayout layout = ( oldC.getLayout() instanceof BorderLayout )
            ? ( BorderLayout )oldC.getLayout()
            : null;

    JLayeredPane oldLayeredPane = (oldInstance instanceof JLayeredPane)
            ? (JLayeredPane) oldInstance
            : null;

    // Pending. Assume all the new children are unaltered.
    for(int i = newChildren.length; i < oldChildren.length; i++) {
        Object[] args = ( layout != null )
                ? new Object[] {oldChildren[i], layout.getConstraints( oldChildren[i] )}
                : (oldLayeredPane != null)
                        ? new Object[] {oldChildren[i], oldLayeredPane.getLayer(oldChildren[i]), Integer.valueOf(-1)}
                        : new Object[] {oldChildren[i]};

        invokeStatement(oldInstance, "add", args, out);
    }
}
 
源代码27 项目: jdk8u-jdk   文件: javax_swing_JLayeredPane.java
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}
 
源代码28 项目: Bytecoder   文件: MetaData.java
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);
    // Ignore the children of a JScrollPane.
    // Pending(milne) find a better way to do this.
    if (oldInstance instanceof javax.swing.JScrollPane) {
        return;
    }
    java.awt.Container oldC = (java.awt.Container)oldInstance;
    java.awt.Component[] oldChildren = oldC.getComponents();
    java.awt.Container newC = (java.awt.Container)newInstance;
    java.awt.Component[] newChildren = (newC == null) ? new java.awt.Component[0] : newC.getComponents();

    BorderLayout layout = ( oldC.getLayout() instanceof BorderLayout )
            ? ( BorderLayout )oldC.getLayout()
            : null;

    JLayeredPane oldLayeredPane = (oldInstance instanceof JLayeredPane)
            ? (JLayeredPane) oldInstance
            : null;

    // Pending. Assume all the new children are unaltered.
    for(int i = newChildren.length; i < oldChildren.length; i++) {
        Object[] args = ( layout != null )
                ? new Object[] {oldChildren[i], layout.getConstraints( oldChildren[i] )}
                : (oldLayeredPane != null)
                        ? new Object[] {oldChildren[i], oldLayeredPane.getLayer(oldChildren[i]), Integer.valueOf(-1)}
                        : new Object[] {oldChildren[i]};

        invokeStatement(oldInstance, "add", args, out);
    }
}
 
源代码29 项目: mzmine2   文件: PeriodicTablePanel.java
/**
 * Constructor of the PeriodicTablePanel object
 */
public PeriodicTablePanel() {
  super();
  setLayout(new BorderLayout());
  layeredPane = new JLayeredPane();
  layeredPane.setPreferredSize(new Dimension(581, 435));
  JPanel tp = PTPanel();
  tp.setBounds(8, 85, 570, 340);

  panel = CreateLabelProperties(null);

  layeredPane.add(tp, new Integer(0));
  layeredPane.add(panel, new Integer(1));
  add(layeredPane);
}
 
源代码30 项目: ET_Redux   文件: ConcordiaGraphPanel.java
/**
 *
 * @param preferredDatePanel
 */
public void setPreferredDatePanel(JLayeredPane preferredDatePanel) {
    this.preferredDatePanel = preferredDatePanel;
    if (preferredDatePanel != null) {
        initPreferredDatePanel();
    }
}
 
 类所在包
 同包方法