private void addFormatControl(final List<IPropertyControl> controls) {
   mSetNodeFormat = new BooleanProperty(StyleEditorPanel.SET_RESOURCE);
   controls.add(mSetNodeFormat);
   mNodeFormat =
       new EditablePatternComboProperty(
           StyleEditorPanel.NODE_FORMAT,
           PatternFormat.getIdentityPatternFormat(),
           FormatController.getController().getAllFormats());
   controls.add(mNodeFormat);
   final NodeFormatChangeListener listener =
       new NodeFormatChangeListener(mSetNodeFormat, mNodeFormat);
   mSetNodeFormat.addPropertyChangeListener(listener);
   mNodeFormat.addPropertyChangeListener(listener);
   mNodeFormat.fireOnMouseClick();
 }
Exemple #2
0
  @SuppressWarnings("serial")
  @Override
  public void init() {
    try {
      appletLock.lock();
      appletResourceController = new AppletResourceController(this);
      if (appletResourceController == null) {
        appletResourceController = new AppletResourceController(this);
      }
      new ParserDelegator() {
        {
          setDefaultDTD();
        }
      };
      updateLookAndFeel();
      createRootPane();
      controller = new Controller(appletResourceController);
      appletResourceController.init();
      Controller.setCurrentController(controller);
      final Container contentPane = getContentPane();
      contentPane.setLayout(new BorderLayout());
      MapViewController mapViewController = new MapViewController(controller);
      appletViewController = new AppletViewController(this, controller, mapViewController);
      controller.addAction(new ViewLayoutTypeAction(MapViewLayout.OUTLINE));
      FilterController.install();
      PrintController.install();
      HelpController.install();
      NodeHistory.install(controller);
      FormatController.install(new FormatController());
      ModelessAttributeController.install();
      TextController.install();
      MapController.install();

      TimeController.install();
      LinkController.install();
      IconController.install();
      FilterController.getCurrentFilterController()
          .getConditionFactory()
          .addConditionController(7, new LogicalStyleFilterController());
      final BModeController browseController = BModeControllerFactory.createModeController();
      final Set<String> emptySet = Collections.emptySet();
      FilterController.getController(controller).loadDefaultConditions();
      browseController.updateMenus("/xml/appletMenu.xml", emptySet);
      controller.addAction(new ShowSelectionAsRectangleAction());
      controller.addAction(new NextNodeAction(Direction.FORWARD));
      controller.addAction(new NextNodeAction(Direction.BACK));
      controller.addAction(new NextPresentationItemAction());
      controller.selectMode(browseController);
      appletResourceController.setPropertyByParameter(this, "browsemode_initial_map");
      appletViewController.init(controller);
      final GlassPane glassPane = new GlassPane();
      setGlassPane(glassPane);
      glassPane.setVisible(true);
      controller.getViewController().setMenubarVisible(false);
    } catch (RuntimeException e) {
      e.printStackTrace();
      throw e;
    } finally {
      appletLock.unlock();
    }
  }
 /**
  * Applies default date-time format for dates or default number format for numbers. All other
  * objects are left unchanged.
  *
  * @return {@link IFormattedObject} if object is formattable and the unchanged object otherwise.
  */
 public Object format(final Object object) {
   return FormatController.formatUsingDefault(object);
 }
 /**
  * Applies default date format (instead of standard date-time) format on the given date.
  *
  * @return {@link IFormattedObject} if object is formattable and the unchanged object otherwise.
  */
 public Object formatDate(final Date date) {
   final String format = FormatController.getController().getDefaultDateFormat().toPattern();
   return FormatController.format(date, format);
 }
 /**
  * uses formatString to return a FormattedObject.
  *
  * <p><em>Note:</em> If you want to format the node core better use the format node attribute
  * instead:
  *
  * <pre>
  * node.object = new Date()
  * node.format = 'dd/MM/yy'
  * </pre>
  *
  * @return {@link IFormattedObject} if object is formattable and the unchanged object otherwise.
  */
 public Object format(final Object object, final String formatString) {
   return FormatController.format(object, formatString);
 }