微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javax.swing.JComponent的实例源码

项目:marathonv5    文件DropDemo.java   
/**
 * Create the GUI and show it. For thread safety,this method should be
 * invoked from the event-dispatching thread.
 */
public static JFrame createAndShowGUI() {
    // Create and set up the window.
    JFrame frame = new JFrame("DropDemo");
    frame.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE);

    // Create and set up the content pane.
    JComponent newContentPane = new DropDemo();
    newContentPane.setopaque(true); // content panes must be opaque
    frame.setContentPane(newContentPane);

    // display the window.
    frame.pack();
    frame.setVisible(true);
    return frame;
}
项目:alevin-svn2    文件PaneledGuiDemo.java   
@Override
protected JComponent createCenterPane() {
    graPHPanel = new SampleGraPHPanel();
    graPHPanel.setPreferredSize(new Dimension(600,300));
    new DropTarget(graPHPanel,new FileDropTargetListener() {
        @Override
        protected void openFile(File file) {
            // insert your own function for loading a file
            JOptionPane.showMessageDialog(graPHPanel,"Opened " + file.getName());
        }

        @Override
        protected boolean canopenFile() {
            // is GUI ready for opening a file?
            return true;
        }
    });
    return graPHPanel;
}
项目:incubator-netbeans    文件JAXBWizardIterator.java   
public void initialize(WizardDescriptor wiz) {
    this.wizardDescriptor = wiz;

    Object prop = wiz.getProperty(WizardDescriptor.PROP_CONTENT_DATA); //NOI18N
    String[] beforeSteps = null;
    if (prop != null && prop instanceof String[]) {
        beforeSteps = (String[]) prop;
    }
    String[] steps = createSteps(beforeSteps,panels);

    // Make sure list of steps is accurate.
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX,//NOI18N
                                                new Integer(i)); 
            // Step name (actually the whole list for reference).
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA,steps); //NOI18N
        }
    }        
}
项目:rapidminer    文件TreeUI.java   
protected void paintHorizontalSeparators(Graphics g,JComponent c) {
    Rectangle clipBounds = g.getClipBounds();

    int beginRow = getRowForPath(this.tree,getClosestPathForLocation(this.tree,clipBounds.y));
    int endRow = getRowForPath(this.tree,clipBounds.y + clipBounds.height - 1));

    if ((beginRow <= -1) || (endRow <= -1)) {
        return;
    }

    for (int i = beginRow; i <= endRow; ++i) {
        TreePath path = getPathForRow(this.tree,i);

        if ((path != null) && (path.getPathCount() == 2)) {
            Rectangle rowBounds = getPathBounds(this.tree,getPathForRow(this.tree,i));

            // Draw a line at the top
            if (rowBounds != null) {
                g.drawLine(clipBounds.x,rowBounds.y,clipBounds.x + clipBounds.width,rowBounds.y);
            }
        }
    }

}
项目:Cognizant-Intelligent-Test-Scripter    文件Imagegallery.java   
/**
 * create returns the thumb selector component
 *
 * @param f
 * @return
 */
private JComponent getThumbSelector(final String f) {
    final JCheckBox cb = new JCheckBox();
    cb.setText("");
    cb.setSelected(false);
    cb.setName(f);
    cb.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (cb.isSelected()) {
                selflist.add(f);
            } else {
                selflist.remove(f);
            }
        }
    });
    cb.setPreferredSize(CB_SIZE);
    return cb;

}
项目:Pogamut3    文件ExampleBotProjectWizardIterator.java   
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;
    index = 0;
    panels = createPanels();
    // Make sure list of steps is accurate.
    String[] steps = createSteps();
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            // Todo if using org.openide.dialogs >= 7.8,can use WizardDescriptor.PROP_*:
            jc.putClientProperty("WizardPanel_contentSelectedindex",new Integer(i));
            // Step name (actually the whole list for reference).
            jc.putClientProperty("WizardPanel_contentData",steps);
        }
    }
}
项目:Equella    文件AdvancedScriptControlEditor.java   
private JComponent createDetailsSection()
{
    final JLabel notesLabel = new JLabel(getString("label.notes")); //$NON-NLS-1$

    notes = new JTextArea();
    notes.setWrapStyleWord(true);
    notes.setLineWrap(true);
    notes.setRows(3);
    notes.setBorder(new EmptyBorder(0,10,0));

    final int height1 = notesLabel.getPreferredSize().height;
    final int height2 = notes.getPreferredSize().height;

    final int[] rows = {height1,height2};
    final int[] cols = {TableLayout.FILL};
    final JPanel all = new JPanel(new TableLayout(rows,cols));

    all.add(notesLabel,new Rectangle(0,1,1));
    all.add(new JScrollPane(notes),1));

    return all;
}
项目:rapidminer    文件SafeModeDialog.java   
@Override
protected JButton makeNoButton() {
    ResourceAction noAction = new ResourceAction("start.normally") {

        private static final long serialVersionUID = -8887199234055845095L;

        @Override
        public void actionPerformed(ActionEvent e) {
            setReturnoption(NO_OPTION);
            no();
        }
    };
    getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
            .put(Keystroke.getKeystroke(KeyEvent.VK_ESCAPE,false),"NO");
    getRootPane().getActionMap().put("NO",noAction);
    JButton noButton = new JButton(noAction);
    return noButton;
}
项目:incubator-netbeans    文件ReflectiveCustomizerProvider.java   
private JComponent createBooleanoption(OptionDescriptor option,Preferences prefs)  {
    JCheckBox checkBox = new JCheckBox();

    org.openide.awt.Mnemonics.setLocalizedText(checkBox,option.displayName);
    checkBox.setToolTipText(option.tooltip);
    checkBox.addActionListener(new ActionListenerImpl(option.preferencesKey,prefs));

    checkBox.setSelected(prefs.getBoolean(option.preferencesKey,Boolean.TRUE == option.defaultValue));
    prefs.putBoolean(option.preferencesKey,checkBox.isSelected());
    GridBagConstraints constraints = new GridBagConstraints();

    constraints.anchor = GridBagConstraints.WEST;
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridheight = 1;
    constraints.gridwidth = 2;
    constraints.gridx = 0;
    constraints.gridy = row++;
    constraints.weightx = 0;
    constraints.weighty = 0;

    add(checkBox,constraints);
    return checkBox;
}
项目:incubator-netbeans    文件EditorProvider.java   
private JComponent getEditorComponent(JComponent text) {
    if ( !Config.getDefault().isLineNumbers()) {
        return text;
    }
    JComponent lineNumber = getLineNumberComponent(getParent(text));

    if (lineNumber == null) {
        return text;
    }
    List<JComponent> components = new ArrayList<JComponent>();

    components.add(lineNumber);
    components.add(text);

    return new ComponentPanel(components);
}
项目:incubator-netbeans    文件WatchAnnotationProvider.java   
@Override
public void watchRemoved(Watch watch) {
    synchronized(watchToAnnotation) {
        Annotation annotation = watchToAnnotation.remove(watch);
        if(annotation != null) {
            annotation.detach();
        }
        JComponent frame = watchToWindow.remove(watch);
        if(frame != null) {
            EditorUI eui = ((StickyPanel) frame).eui;
            eui.getStickyWindowSupport().removeWindow(frame);
        }
    }
}
项目:incubator-netbeans    文件ComponentsTest.java   
@HTMLComponent(
    url = "simple.html",className = "TestPages",type = JComponent.class,techIds = "second"
) 
static void getSwing(int param,CountDownLatch called) {
    assertEquals(param,"Correct value passed in");
    called.countDown();
    ATech t = Contexts.find(BrwsrCtx.findDefault(ComponentsTest.class),ATech.class);
    assertNotNull(t,"A technology found");
    assertEquals(t.getClass(),ATech.Second.class);
}
项目:rapidminer    文件ProcessGUITools.java   
/**
 * displays an @R_563_4045@ion bubble that alerts the user that the attribute specified in the
 * operator parameters was not found. The bubble is located at the operator and the process view
 * will change to said operator. This method is used after the error occurred during process
 * execution.
 *
 * @param error
 *            the error containing all the @R_563_4045@ion about the operator,the parameter and the
 *            name of the attribute which was not found
 * @param i18nKey
 *            the i18n key which defines the title,text and button label for the bubble. Format
 *            is "gui.bubble.{i18nKey}.title","gui.bubble.{i18nKey}.body" and
 *            "gui.bubble.{i18nKey}.button.label".
 * @param isError
 *            if {@code true},an error bubble will be shown; otherwise a warning bubble is
 *            displayed
 * @param arguments
 *            optional i18n arguments
 * @return the {@link OperatorInfoBubble} instance,never {@code null}
 */
private static OperatorInfoBubble displayAttributeNotFoundParameter@R_563_4045@ion(final AttributeNotFoundError error,final boolean isError,final String i18nKey,final Object... arguments) {
    final Operator op = error.getoperator();
    final ParameterType param = op.getParameterType(error.getKey());
    final JButton ackButton = new JButton(I18N.getGUIMessage("gui.bubble." + i18nKey + ".button.label",arguments));
    ackButton.setToolTipText(I18N.getGUIMessage("gui.bubble." + i18nKey + ".button.tip"));

    String decoratorKey = param instanceof CombinedParameterType || param instanceof ParameterTypeAttributes
            ? "attributes_not_found_decoration" : "attribute_not_found_decoration";

    ParameterErrorBubbleBuilder builder = new ParameterErrorBubbleBuilder(rapidminerGUI.getMainFrame(),op,param,decoratorKey,i18nKey,arguments);
    final ParameterErrorInfoBubble attributeNotFoundParameterBubble = builder.setHideOndisable(true)
            .setAlignment(AlignedSide.BottOM).setStyle(isError ? BubbleStyle.ERROR : BubbleStyle.WARNING)
            .setEnsureVisible(true).hideCloseButton().setHideOnProcessRun(true)
            .setAdditionalComponents(new JComponent[] { ackButton }).build();

    ackButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            attributeNotFoundParameterBubble.killBubble(true);
        }
    });

    attributeNotFoundParameterBubble.setVisible(true);
    return attributeNotFoundParameterBubble;
}
项目:ramus    文件ModelPropertiesDialog.java   
private void clearPopupMenu(JComponent component) {
    component.setComponentPopupMenu(null);
    for (int i = 0; i < component.getComponentCount(); i++) {
        Component c = component.getComponent(i);
        if (c instanceof JComponent)
            clearPopupMenu((JComponent) c);
    }
}
项目:incubator-netbeans    文件ViewUtil.java   
private static boolean isInTabbedContainer( Component c ) {
    Component parent = c.getParent();
    while( null != parent ) {
        if( parent instanceof JComponent
                && "TabbedContainerUI".equals( ((JComponent)parent).getUIClassID() ) ) //NOI18N
            return true;
        parent = parent.getParent();
    }
    return false;
}
项目:openjdk-jdk10    文件ToolBarSeparatorPainter.java   
@Override
protected void doPaint(Graphics2D g,JComponent c,int width,int height,Object[] extendedCacheKeys) {
    //it is assumed that in the normal orientation the separator renders
    //horizontally. Other code rotates it as necessary for a vertical
    //separator.
    g.setColor(c.getForeground());
    int y = height / 2;
    for (int i=INSET; i<=width-INSET; i+=SPACE) {
        g.fillRect(i,y,1);
    }
}
项目:incubator-netbeans    文件RepoSelectorPanel.java   
RepoSelectorPanel(JComponent repoSelector,JComponent newRepoButton) {
    super(null);
    JLabel repoSelectorLabel = new JLabel();

    repoSelectorLabel.setLabelFor(repoSelector);
    repoSelectorLabel.setFocusCycleRoot(true);

    Mnemonics.setLocalizedText(
           repoSelectorLabel,NbBundle.getMessage(getClass(),"QueryTopComponent.repoLabel.text"));//NOI18N

    setopaque(false);

    newRepoButton.addFocusListener(this);
    repoSelector.addFocusListener(this);

    GroupLayout layout;
    setLayout(layout = new GroupLayout(this));
    layout.setHorizontalGroup(
            layout.createSequentialGroup()
                    .addComponent(repoSelectorLabel)
                    .addPreferredGap(RELATED)
                    .addComponent(repoSelector)
                    .addPreferredGap(RELATED)
                    .addComponent(newRepoButton));
    layout.setVerticalGroup(
            layout.createParallelGroup(BASELINE)
                    .addComponent(repoSelectorLabel)
                    .addComponent(repoSelector,DEFAULT_SIZE,PREFERRED_SIZE)
                    .addComponent(newRepoButton));
}
项目:incubator-netbeans    文件PrintAction.java   
private String getName(List<JComponent> printable,JComponent top) {
    for (JComponent component : printable) {
        Object object = component.getClientProperty(PrintManager.PRINT_NAME);

        if (object instanceof String) {
            return (String) object;
        }
    }
    return getName(getData(top));
}
项目:Openjsharp    文件MultiButtonUI.java   
/**
 * Returns a multiplexing UI instance if any of the auxiliary
 * <code>LookAndFeel</code>s supports this UI.  Otherwise,just returns the
 * UI object obtained from the default <code>LookAndFeel</code>.
 */
public static ComponentUI createUI(JComponent a) {
    ComponentUI mui = new MultiButtonUI();
    return MultiLookAndFeel.createUIs(mui,((MultiButtonUI) mui).uis,a);
}
项目:openjdk-jdk10    文件MultiDesktopIconUI.java   
/**
 * Invokes the <code>getPreferredSize</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Dimension getPreferredSize(JComponent a) {
    Dimension returnValue =
        uis.elementAt(0).getPreferredSize(a);
    for (int i = 1; i < uis.size(); i++) {
        uis.elementAt(i).getPreferredSize(a);
    }
    return returnValue;
}
项目:incubator-netbeans    文件WinClassicViewTabdisplayerUI.java   
@Override
public Dimension getPreferredSize(JComponent c) {
    FontMetrics fm = getTxtFontMetrics();
    int height = fm == null ?
            19 : fm.getAscent() + 2 * fm.getDescent() + 2;
    Insets insets = c.getInsets();
    prefSize.height = height + insets.bottom + insets.top;
    return prefSize;
}
项目:incubator-netbeans    文件MetalViewTabdisplayerUI.java   
/**
 * Paints bottom "activation" line
 */
private void paintBottomBorder(Graphics g,JComponent c) {
    Color color = isActive() ? getActBgColor() : getInactBgColor();
    g.setColor(color);
    Rectangle bounds = c.getBounds();
    g.fillRect(1,bounds.height - 3,bounds.width - 1,2);
    g.setColor(getBorderShadow());
    g.drawLine(1,bounds.height - 1,bounds.height - 1);
}
项目:xdman    文件XDMProgressBarUI.java   
@Override
protected void paintDeterminate(Graphics g,JComponent c) {
    Insets b = progressBar.getInsets(); // area for border
    int barRectWidth = progressBar.getWidth() - (b.right + b.left);
    int barRectHeight = progressBar.getHeight() - (b.top + b.bottom);

    if (barRectWidth <= 0 || barRectHeight <= 0) {
        return;
    }

    // amount of progress to draw
    int amountFull = getAmountFull(b,barRectWidth,barRectHeight);

    Graphics2D g2 = (Graphics2D) g;
    g2.setColor(progressBar.getForeground());

    if (progressBar.getorientation() == JProgressBar.HORIZONTAL) {
        g2.setPaint(high);
        g2.fillRect(0,amountFull,c.getHeight() / 2);
        g2.setPaint(low);
        g2.fillRect(0,c.getHeight() / 2,c.getHeight());
    } else { // VERTICAL
    }

    // Deal with possible text painting
    if (progressBar.isstringPainted()) {
        paintString(g,b.left,b.top,barRectHeight,b);
    }
}
项目:openjdk-jdk10    文件MultiTextUI.java   
/**
 * Invokes the <code>getAccessibleChild</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public Accessible getAccessibleChild(JComponent a,int b) {
    Accessible returnValue =
        uis.elementAt(0).getAccessibleChild(a,b);
    for (int i = 1; i < uis.size(); i++) {
        uis.elementAt(i).getAccessibleChild(a,b);
    }
    return returnValue;
}
项目:Moenagade    文件LayoutStyle.java   
/**
 * Returns the amount to indent the specified component if it's
 * a JCheckBox or JRadioButton.  If the component is not a JCheckBox or
 * JRadioButton,0 will be returned.
 */
int getButtonChildindent(JComponent c,int position) {
    if ((c instanceof JRadioButton) || (c instanceof JCheckBox)) {
        AbstractButton button = (AbstractButton)c;
        Insets insets = c.getInsets();
        Icon icon = getIcon(button);
        int gap = button.getIconTextGap();
        if (isLeftAligned(button,position)) {
            return insets.left + icon.getIconWidth() + gap;
        } else if (isRightAligned(button,position)) {
            return insets.right + icon.getIconWidth() + gap;
        }
    }
    return 0;
}
项目:Moenagade    文件GroupLayout.java   
PaddingSpring(JComponent source,JComponent target,int type,boolean cangrow) {
    this.source = source;
    this.target = target;
    this.type = type;
    this.cangrow = cangrow;
}
项目:incubator-netbeans    文件DynaMenuModel.java   
private JComponent[] convertArray(JComponent[] arr) {
    if (arr == null || arr.length == 0) {
        return new JComponent[] { new InvisibleMenuItem() };
    }
    JComponent[] toRet = new JComponent[arr.length];
    for (int i = 0; i < arr.length; i++) {
        if (arr[i] == null) {
            toRet[i] = createSeparator();
        } else {
            toRet[i] = arr[i];
        }
    }
    return toRet;
}
项目:incubator-netbeans    文件PropertiesTable.java   
public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int rowIndex,int columnIndex) {
    Component renderer =  super.getTableCellRendererComponent(table,value,hasFocus,rowIndex,columnIndex);
    if (renderer instanceof JComponent) {
        String strValue = tableModel.getNode(rowIndex).getValue(); 
        ((JComponent) renderer).setToolTipText(strValue);
    }
    setToolTipText(value.toString());
    return renderer;
}
项目:Openjsharp    文件MultiOptionPaneUI.java   
/**
 * Invokes the <code>getAccessibleChildrenCount</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public int getAccessibleChildrenCount(JComponent a) {
    int returnValue =
        ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a);
    for (int i = 1; i < uis.size(); i++) {
        ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a);
    }
    return returnValue;
}
项目:incubator-netbeans    文件NumberFieldEditor.java   
@Override
public boolean verify(JComponent input) {
    if (dbColumn != null && input instanceof JTextComponent) {
        String inputText = ((JTextComponent) input).getText();
        try {
            DBReadWriteHelper.validate(inputText,dbColumn);
        } catch (DBException ex) {
            return false;
        }
        return true;
    } else {
        return true;
    }
}
项目:incubator-netbeans    文件ComponentPanel.java   
private int getWidth(JComponent component) {
    Dimension size = getSize(component);

    if (size == null) {
        return component.getWidth();
    }
    return size.width;
}
项目:Equella    文件GroupEditor.java   
private JComponent createDetails()
{
    JLabel titleLabel = new JLabel(CurrentLocale.get("wizard.controls.title")); //$NON-NLS-1$
    JLabel descriptionLabel = new JLabel(CurrentLocale.get("wizard.controls.description")); //$NON-NLS-1$

    title = new I18nTextField(BundleCache.getLanguages());
    description = new I18nTextField(BundleCache.getLanguages());
    mandatory = new JCheckBox(CurrentLocale.get("wizard.controls.mandatory")); //$NON-NLS-1$
    multiselect = new JCheckBox(CurrentLocale.get("wizard.controls.multiplegroups")); //$NON-NLS-1$

    final int width1 = descriptionLabel.getPreferredSize().width;
    final int height1 = title.getPreferredSize().height;

    final int[] rows = {height1,height1,};
    final int[] cols = {width1,TableLayout.FILL,};

    JPanel all = new JPanel(new TableLayout(rows,cols));

    all.add(titleLabel,1));
    all.add(title,new Rectangle(1,1));

    all.add(descriptionLabel,1));
    all.add(description,1));

    all.add(mandatory,2,1));
    all.add(multiselect,3,1));

    return all;
}
项目:incubator-netbeans    文件NewJavaFileWizardIterator.java   
@Override
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;
    index = 0;
    final Project project = Templates.getProject(wiz);
    final JavaFileWizardIteratorFactory templateProvider = project != null ? project.getLookup().lookup(JavaFileWizardIteratorFactory.class) : null;
    if (templateProvider != null) {
        projectSpecificIterator = templateProvider.createIterator(Templates.getTemplate(wiz));
        asInstantiatingIterator(projectSpecificIterator)
                .ifPresent((it)->it.initialize(wiz));
    }
    panels = createPanels(wiz,projectSpecificIterator);
    // Make sure list of steps is accurate.
    String[] beforeSteps = null;
    Object prop = wiz.getProperty(WizardDescriptor.PROP_CONTENT_DATA);
    if (prop != null && prop instanceof String[]) {
        beforeSteps = (String[])prop;
    }
    String[] steps = createSteps (beforeSteps,panels);
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent)c;
            // Step #.
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX,new Integer(i));
            // Step name (actually the whole list for reference).
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA,steps);
        }
    }
}
项目:rapidminer    文件CollapsibleErrorTable.java   
public CollapsibleErrorTable(AbstractErrorWarningTableModel errorWarningTableModel) {
    this.errorWarningTableModel = errorWarningTableModel;
    errorTable = new JTable(errorWarningTableModel) {

        private static final long serialVersionUID = 1L;

        @Override
        public Component prepareRenderer(TableCellRenderer renderer,int row,int column) {
            // add tooltip for last column
            JComponent component = (JComponent) super.prepareRenderer(renderer,row,column);
            if (column == getColumnCount() - 1) {
                component.setToolTipText(getValueAt(row,column).toString());
            }
            return component;
        }

    };
    errorScrollPane = new JScrollPane(errorTable);
    errorWarningTableModel.addTableModelListener(new TableModelListener() {

        @Override
        public void tableChanged(TableModelEvent e) {
            update();
        }
    });
    setupGUI();
}
项目:jdk8u-jdk    文件MultiPopupMenuUI.java   
/**
 * Invokes the <code>contains</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI,which is
 * the UI obtained from the default <code>LookAndFeel</code>
 */
public boolean contains(JComponent a,int b,int c) {
    boolean returnValue =
        ((ComponentUI) (uis.elementAt(0))).contains(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((ComponentUI) (uis.elementAt(i))).contains(a,c);
    }
    return returnValue;
}
项目:incubator-netbeans    文件RemoteRepository.java   
public FileConnectionSettingsType () {
    this.inputFields = new JComponent[] {
        panel.directorybrowseButton,panel.proxySettingsButton,panel.repositoryLabel,panel.tipLabel
    };
    acceptableSchemes = EnumSet.of(Scheme.FILE);
}
项目:incubator-netbeans    文件AbstractViewTabdisplayerUI.java   
@Override
public void paint(Graphics g,JComponent c) {

    ColorUtil.setupAntialiasing(g);

    TabData tabData;
    int x,width,height;
    String text;

    paintdisplayerBackground( g,c );

    for (int i = 0; i < dataModel.size(); i++) {
        // gather data
        tabData = dataModel.getTab(i);
        x = layoutModel.getX(i);
        y = layoutModel.getY(i);
        width = layoutModel.getW(i);
        height = layoutModel.getH(i);
        text = tabData.getText();
        // perform paint
        if (g.hitClip(x,height)) {
            paintTabBackground(g,i,x,height);
            paintTabContent(g,text,height);
            paintTabBorder(g,height);
        }
    }
}
项目:CoverageGA    文件SensorDrawUtility.java   
public static BufferedImage getAreaAsImage(final int w,final int h,final JComponent component) {
    final int type = BufferedImage.TYPE_INT_RGB;
    final BufferedImage image = new BufferedImage(w,h,type);
    final Graphics2D g2 = image.createGraphics();
    component.paint(g2);
    g2.dispose();
    return image;
}
项目:incubator-netbeans    文件CustomizerCategoryProvider.java   
public JComponent createComponent(Category category,Lookup context) {
    Project project = getProject(context);
    ConfigFileManager manager = getConfigFileManager(project);
    SpringCustomizerPanel panel = new SpringCustomizerPanel(project,manager.getConfigFiles(),manager.getConfigFileGroups());
    CategoryListener listener = new CategoryListener(manager,panel);
    category.setokButtonListener(listener);
    category.setStoreListener(listener);
    return panel;
}
项目:jdk8u-jdk    文件MultiScrollBarUI.java   
/**
 * Returns a multiplexing UI instance if any of the auxiliary
 * <code>LookAndFeel</code>s supports this UI.  Otherwise,just returns the
 * UI object obtained from the default <code>LookAndFeel</code>.
 */
public static ComponentUI createUI(JComponent a) {
    ComponentUI mui = new MultiScrollBarUI();
    return MultiLookAndFeel.createUIs(mui,((MultiScrollBarUI) mui).uis,a);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。