Package org.pentaho.reporting.libraries.designtime.swing

Examples of org.pentaho.reporting.libraries.designtime.swing.KeyedComboBoxModel$ComboBoxItemPair


    add(whitespacePanel);
  }

  private KeyedComboBoxModel createTextAlignmentModel()
  {
    final KeyedComboBoxModel model = new KeyedComboBoxModel();
    model.add(VerticalTextAlign.TOP, Messages.getString("ParagraphPropertiesPane.Top"));
    model.add(VerticalTextAlign.CENTRAL, Messages.getString("ParagraphPropertiesPane.Central"));
    model.add(VerticalTextAlign.MIDDLE, Messages.getString("ParagraphPropertiesPane.Middle"));
    model.add(VerticalTextAlign.BASELINE, Messages.getString("ParagraphPropertiesPane.Baseline"));
    model.add(VerticalTextAlign.USE_SCRIPT, Messages.getString("ParagraphPropertiesPane.UseScript"));
    model.add(VerticalTextAlign.TEXT_TOP, Messages.getString("ParagraphPropertiesPane.TextTop"));
    model.add(VerticalTextAlign.TEXT_BOTTOM, Messages.getString("ParagraphPropertiesPane.TextBottom"));
    model.add(VerticalTextAlign.SUB, Messages.getString("ParagraphPropertiesPane.Subscript"));
    model.add(VerticalTextAlign.SUPER, Messages.getString("ParagraphPropertiesPane.Superscript"));
    model.add(VerticalTextAlign.BOTTOM, Messages.getString("ParagraphPropertiesPane.Bottom"));
    return model;
  }
View Full Code Here


    return model;
  }

  private KeyedComboBoxModel createWhitspaceModel()
  {
    final KeyedComboBoxModel model = new KeyedComboBoxModel();
    model.add(WhitespaceCollapse.COLLAPSE, Messages.getString("ParagraphPropertiesPane.CollapseWhitespaces"));
    model.add(WhitespaceCollapse.DISCARD, Messages.getString("ParagraphPropertiesPane.DiscardAllWhitespaces"));
    model.add(WhitespaceCollapse.PRESERVE, Messages.getString("ParagraphPropertiesPane.PreserveAllWhitespaces"));
    model.add(WhitespaceCollapse.PRESERVE_BREAKS, Messages.getString("ParagraphPropertiesPane.PreserveBreaks"));
    return model;
  }
View Full Code Here

    return panel;
  }

  private KeyedComboBoxModel createFontSmoothModel()
  {
    final KeyedComboBoxModel model = new KeyedComboBoxModel();
    model.add(FontSmooth.NEVER, Messages.getString("FontPropertiesPane.Never"));
    model.add(FontSmooth.AUTO, Messages.getString("FontPropertiesPane.Automatic"));
    model.add(FontSmooth.ALWAYS, Messages.getString("FontPropertiesPane.Always"));
    return model;
  }
View Full Code Here

  }

  private KeyedComboBoxModel createLocalesModel()
  {
    final KeyedComboBoxModel cn = new KeyedComboBoxModel();
    final Locale[] locales = Locale.getAvailableLocales();
    for (int i = 0; i < locales.length; i++)
    {
      final Locale locale = locales[i];
      cn.add(locale, locale.getDisplayName());
    }
    cn.setSelectedKey(Locale.getDefault());
    return cn;
  }
View Full Code Here

      final Object theSource = e.getSource();
      if (theSource instanceof JComboBox)
      {
        final JComboBox theComboBox = (JComboBox) theSource;
        final KeyedComboBoxModel theModel = (KeyedComboBoxModel) theComboBox.getModel();
        updateContext.setParameterValue(key, theModel.getSelectedKey());
      }
    }
View Full Code Here

  public void initialize() throws ReportDataFactoryException
  {
    adjustingToExternalInput = true;
    try
    {
      final KeyedComboBoxModel keyedComboBoxModel =
          DefaultParameterComponentFactory.createModel(listParameter, parameterContext);
      list.setModel(keyedComboBoxModel);

      final ListSelectionModel selectionModel = list.getSelectionModel();
      final Object value = updateContext.getParameterValue(listParameter.getName());
      final HashSet keylist = getNormalizedSet(value);
      selectionModel.setValueIsAdjusting(true);
      list.clearSelection();

      final int size = keyedComboBoxModel.getSize();
      for (int i = 0; i < size; i++)
      {
        final Object key = keyedComboBoxModel.getKeyAt(i);
        if (isSafeMatch(key, keylist))
        {
          selectionModel.addSelectionInterval(i, i);
        }
      }
View Full Code Here

      }
      try
      {
        adjustingToUserInput = true;

        final KeyedComboBoxModel theModel = (KeyedComboBoxModel) list.getModel();
        final int index = list.getSelectedIndex();
        if (index == -1)
        {
          updateContext.setParameterValue(key, null);
        }
        else
        {
          updateContext.setParameterValue(key, theModel.getKeyAt(index));
        }
      }
      finally
      {
        adjustingToUserInput = false;
View Full Code Here

      try
      {
        adjustingToUserInput = true;

        final KeyedComboBoxModel listModel = (KeyedComboBoxModel) list.getModel();
        final ListSelectionModel selectionModel = list.getSelectionModel();
        selectionModel.setValueIsAdjusting(true);

        // Determine if this selection has added or removed items
        final HashSet<Integer> newSelections = new HashSet<Integer>();
        final int size = listModel.getSize();
        for (int i = 0; i < size; i++)
        {
          if (selectionModel.isSelectedIndex(i))
          {
            newSelections.add(i);
          }
        }

        // Turn on everything that was selected previously
        Iterator it = selectionCache.iterator();
        while (it.hasNext())
        {
          final Integer integer = (Integer) it.next();
          final int index = integer.intValue();
          selectionModel.addSelectionInterval(index, index);
        }

        // Add or remove the delta

        if (newSelections.containsAll(selectionCache) == false)
        {
          it = newSelections.iterator();
          while (it.hasNext())
          {
            final Integer nextInt = (Integer) it.next();
            final int index = nextInt.intValue();
            if (selectionCache.contains(nextInt))
            {
              selectionModel.removeSelectionInterval(index, index);
            }
            else
            {
              selectionModel.addSelectionInterval(index, index);
            }
          }

          // Save selections for next time
          selectionCache.clear();
          for (int i = 0; i < size; i++)
          {
            if (selectionModel.isSelectedIndex(i))
            {
              selectionCache.add(i);
            }
          }
        }

        selectionModel.setValueIsAdjusting(false);

        final int[] indices = list.getSelectedIndices();
        final Object[] keys = new Object[indices.length];
        for (int i = 0; i < keys.length; i++)
        {
          final int index = indices[i];
          keys[i] = listModel.getKeyAt(index);
        }
        updateContext.setParameterValue(key, keys);
      }
      finally
      {
View Full Code Here

    zoomActions = new HashMap<ActionCategory, ZoomAction[]>();

    this.menus = PreviewPane.EMPTY_MENU;
    setLayout(new BorderLayout());

    zoomModel = new KeyedComboBoxModel();
    zoomModel.setAllowOtherValue(true);
    zoom = PreviewPane.ZOOM_FACTORS[PreviewPane.DEFAULT_ZOOM_INDEX];

    final Configuration configuration = ClassicEngineBoot.getInstance().getGlobalConfig();
    minZoom = getMinimumZoom(configuration);
View Full Code Here

    clear();
  }

  private KeyedComboBoxModel loadEpson24Printers()
  {
    final KeyedComboBoxModel epsonPrinters = new KeyedComboBoxModel();
    final PrinterSpecificationManager spec24Manager =
        Epson24PinPrinterDriver.loadSpecificationManager();
    final String[] printer24Names =
        spec24Manager.getPrinterNames();
    Arrays.sort(printer24Names);
    for (int i = 0; i < printer24Names.length; i++)
    {
      final PrinterSpecification pspec = spec24Manager.getPrinter(
          printer24Names[i]);
      epsonPrinters.add(pspec, pspec.getDisplayName());
    }
    return epsonPrinters;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.designtime.swing.KeyedComboBoxModel$ComboBoxItemPair

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.