Package javax.swing

Examples of javax.swing.DefaultListCellRenderer$UIResource


        MultiColumnBrowserRenderer() {

            leafRenderer = CellRenderers.listRenderer();

            nonLeafTextRenderer = new DefaultListCellRenderer() {
                public Border getBorder() {
                    return null;
                }
            };
View Full Code Here


        createUI();
    }
   
    private void createUI() {
        final JComboBox selection = new JComboBox(options);
        selection.setRenderer(new DefaultListCellRenderer() {
            @Override
            public Component getListCellRendererComponent(final JList list, final Object value, final int index,
                    final boolean isSelected, final boolean cellHasFocus) {
                JLabel l = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected,
                        cellHasFocus);
View Full Code Here

        resultStyle = new SimpleAttributeSet();
        StyleConstants.setItalic(resultStyle, true);
        StyleConstants.setForeground(resultStyle, new Color(0x20, 0x4a, 0x87));
       
        completeCombo = new JComboBox();
        completeCombo.setRenderer(new DefaultListCellRenderer()); // no silly ticks!
        completePopup = new BasicComboPopup(completeCombo);
       
        if (message != null) {
            final MutableAttributeSet messageStyle = new SimpleAttributeSet();
            StyleConstants.setBackground(messageStyle, area.getForeground());
View Full Code Here

    removeAll();
    if ((o != null) && (o.getClass().isArray())) {
      Class elementClass = o.getClass().getComponentType();
      PropertyEditor editor = PropertyEditorManager.findEditor(elementClass);
      Component view = null;
      ListCellRenderer lcr = new DefaultListCellRenderer();
      if (editor != null) {
  if (editor instanceof GenericObjectEditor) {
    ((GenericObjectEditor) editor).setClassType(elementClass);
  }
View Full Code Here

                    "List.cellRenderer");

            // fix for 6711072 some LAFs like Nimbus do not provide this
            // UIManager key and we should not through a NPE here because of it
            if (lcr == null) {
                lcr = new DefaultListCellRenderer();
            }
           
            renderer = lcr.getListCellRendererComponent(
                    list, "a", -1, false, false);
            lafDefaults.put(BASELINE_COMPONENT_KEY, renderer);
View Full Code Here

    removeAll();
    if ((o != null) && (o.getClass().isArray())) {
      Class elementClass = o.getClass().getComponentType();   
      PropertyEditor editor = PropertyEditorManager.findEditor(elementClass);
      Component view = null;
      ListCellRenderer lcr = new DefaultListCellRenderer();
      if (editor != null) {
  if (editor instanceof GenericObjectEditor) {
    ((GenericObjectEditor) editor).setClassType(elementClass);
  }
View Full Code Here

          new Shape[] {
              new Rectangle2D.Double(),
              new RoundRectangle2D.Double(0,0,0,0,50,50),
              new Ellipse2D.Double()
          });
      shapeBox.setRenderer(new DefaultListCellRenderer() {
        @Override
            public Component getListCellRendererComponent(JList list, Object value,
          int index, boolean isSelected, boolean hasFocus) {
          String valueString = value.toString();
          valueString = valueString.substring(0,valueString.indexOf("2D"));
View Full Code Here

      public void actionPerformed(ActionEvent e) {
        uncluster();
      }});
       
        JComboBox layoutTypeComboBox = new JComboBox(layoutClasses);
        layoutTypeComboBox.setRenderer(new DefaultListCellRenderer() {
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                String valueString = value.toString();
                valueString = valueString.substring(valueString.lastIndexOf('.')+1);
                return super.getListCellRendererComponent(list, valueString, index, isSelected,
                        cellHasFocus);
            }
        });
        layoutTypeComboBox.setSelectedItem(FRLayout.class);
        layoutTypeComboBox.addItemListener(new ItemListener() {

      public void itemStateChanged(ItemEvent e) {
        if(e.getStateChange() == ItemEvent.SELECTED) {
          Class clazz = (Class)e.getItem();
          try {
            Layout<String,Number> layout = getLayoutFor(clazz, graph);
            layout.setInitializer(vv.getGraphLayout());
            clusteringLayout.setDelegate(layout);
            vv.setGraphLayout(clusteringLayout);
          } catch(Exception ex) {
            ex.printStackTrace();
          }
        }
      }});
       
        JComboBox subLayoutTypeComboBox = new JComboBox(layoutClasses);
       
        subLayoutTypeComboBox.setRenderer(new DefaultListCellRenderer() {
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                String valueString = value.toString();
                valueString = valueString.substring(valueString.lastIndexOf('.')+1);
                return super.getListCellRendererComponent(list, valueString, index, isSelected,
                        cellHasFocus);
            }
        });
        subLayoutTypeComboBox.addItemListener(new ItemListener() {

      public void itemStateChanged(ItemEvent e) {
        if(e.getStateChange() == ItemEvent.SELECTED) {
          subLayoutType = (Class)e.getItem();
        }
      }});
       
        JComboBox subLayoutDimensionComboBox =
          new JComboBox(new Dimension[]{
              new Dimension(75,75),
              new Dimension(100,100),
              new Dimension(150,150),
              new Dimension(200,200),
              new Dimension(250,250),
              new Dimension(300,300)
          } 
          );
        subLayoutDimensionComboBox.setRenderer(new DefaultListCellRenderer() {
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                String valueString = value.toString();
                valueString = valueString.substring(valueString.lastIndexOf('['));
                valueString = valueString.replaceAll("idth", "");
                valueString = valueString.replaceAll("eight","");
View Full Code Here

            }
        });
        Class[] combos = getCombos();
        final JComboBox jcb = new JComboBox(combos);
        // use a renderer to shorten the layout name presentation
        jcb.setRenderer(new DefaultListCellRenderer() {
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                String valueString = value.toString();
                valueString = valueString.substring(valueString.lastIndexOf('.')+1);
                return super.getListCellRendererComponent(list, valueString, index, isSelected,
                        cellHasFocus);
View Full Code Here

        jp.setLayout(new BorderLayout());
        jp.add(vv, BorderLayout.CENTER);
        Class[] combos = getCombos();
        final JComboBox jcb = new JComboBox(combos);
        // use a renderer to shorten the layout name presentation
        jcb.setRenderer(new DefaultListCellRenderer() {
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                String valueString = value.toString();
                valueString = valueString.substring(valueString.lastIndexOf('.')+1);
                return super.getListCellRendererComponent(list, valueString, index, isSelected,
                        cellHasFocus);
View Full Code Here

TOP

Related Classes of javax.swing.DefaultListCellRenderer$UIResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.