Package net.sourceforge.ganttproject.language

Examples of net.sourceforge.ganttproject.language.GanttLanguage$Listener


         private final boolean hidePrivate = vizState.hidePrivate(), hideMeta = vizState.hideMeta();
         {
            do_start();
            setRootVisible(false);
            setShowsRootHandles(false);
            listeners.add(new Listener() {
               public Object do_action(Object sender, Event event) { return null; }
               public Object do_action(Object sender, Event event, Object arg) { zoom(arg); return null; }
            });
         }
         @Override public String convertValueToText(Object value, boolean sel, boolean expand, boolean leaf, int i, boolean focus) {
View Full Code Here


    public GanttDialogInfo(Frame parent, int msgtype, int button,
            String message, String title) {

        super(parent, title, true);

        GanttLanguage language = GanttLanguage.getInstance();

        res = button;

        Box b1 = Box.createVerticalBox();

        if (msgtype == ERROR)
            b1.add(new JLabel(new ImageIcon(getClass().getResource(
                    "/icons/error.png"))));
        else if (msgtype == WARNING)
            b1.add(new JLabel(new ImageIcon(getClass().getResource(
                    "/icons/warning.png"))));
        else if (msgtype == INFO)
            b1.add(new JLabel(new ImageIcon(getClass().getResource(
                    "/icons/info.png"))));
        else if (msgtype == QUESTION)
            b1.add(new JLabel(new ImageIcon(getClass().getResource(
                    "/icons/question.png"))));

        getContentPane().add(b1, "West");

        Box b2 = Box.createVerticalBox();
        JTextArea textArea = new JTextArea(message);
        textArea.setEditable(false);
        textArea.setBackground(new JLabel().getBackground());
        b2.add(textArea);
        getContentPane().add(b2, "Center");

        JPanel p = new JPanel();
        // YES BUTTON
        JButton yes = new JButton((button == 0) ? language.getText("ok")
                : language.getText("yes"));
        getRootPane().setDefaultButton(yes);
        p.add(yes);
        yes.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                setVisible(false);
                dispose();
                res = YES;
            }
        });

        if (button > 0) {
            // NO BUTTON
            JButton no = new JButton(language.getText("no"));
            p.add(no);
            no.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    setVisible(false);
                    dispose();
                    res = NO;
                }
            });

            if (button > 1) {
                // CANCEL BUTTON
                JButton cancel = new JButton(language.getText("cancel"));
                p.add(cancel);
                cancel.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent evt) {
                        setVisible(false);
                        dispose();
                        res = CANCEL;
                    }
                });
            }
        }

        getContentPane().add(p, BorderLayout.SOUTH);

        pack();
        setResizable(false);
        DialogAligner.center(this, getParent());
        applyComponentOrientation(language.getComponentOrientation());
    }
View Full Code Here

    public TipsDialog(JFrame parent, boolean tips) {
        super(parent, GanttProject.correctLabel(GanttLanguage.getInstance()
                .getText("tipsOfTheDay")), false);

        appli = (GanttProject) parent;
        GanttLanguage lang = GanttLanguage.getInstance();

        Vector vTips = new Vector();
        String prefix = "tips";
        int ind = 1;
        boolean moreTips = !lang.getText(prefix + ind).startsWith(
                GanttLanguage.MISSING_RESOURCE);

        while (moreTips) {
            vTips.add(lang.getText(prefix + ind++));
            moreTips = !lang.getText(prefix + ind).startsWith(
                    GanttLanguage.MISSING_RESOURCE);
        }
        tipsText = new String[vTips.size()];
        vTips.toArray(tipsText);

        // tipsText = new String []{
        // lang.getText("tips1"), lang.getText("tips2"), lang.getText("tips3"),
        // lang.getText("tips4"),
        // lang.getText("tips5"), lang.getText("tips6"), lang.getText("tips7"),
        // lang.getText("tips8"),
        // lang.getText("tips9"), lang.getText("tips10"),
        // lang.getText("tips11"),lang.getText("tips12") ,
        // lang.getText("tips13"),lang.getText("tips14"),
        // lang.getText("tips15"), lang.getText("tips16")
        // };

        index = (int) (Math.random() * tipsText.length);

        pnPanel0 = new JPanel();
        GridBagLayout gbPanel0 = new GridBagLayout();
        GridBagConstraints gbcPanel0 = new GridBagConstraints();
        pnPanel0.setLayout(gbPanel0);

        // Light image
        lbImg = new JLabel(new ImageIcon(getClass().getResource(
                "/icons/info.png")));
        gbcPanel0.gridx = 0;
        gbcPanel0.gridy = 0;
        gbcPanel0.gridwidth = 1;
        gbcPanel0.gridheight = 18;
        gbcPanel0.fill = GridBagConstraints.VERTICAL;
        gbcPanel0.weightx = 0;
        gbcPanel0.weighty = 1;
        gbcPanel0.anchor = GridBagConstraints.NORTH;
        gbPanel0.setConstraints(lbImg, gbcPanel0);
        pnPanel0.add(lbImg);

        // The panel
        taArea0 = new JTextPane();
        taArea0.setPreferredSize(new Dimension(200, 150));
        taArea0.setEditable(false);
        // Set a random text !!
        changeText(tipsText[index]);
        gbcPanel0.gridx = 1;
        gbcPanel0.gridy = 0;
        gbcPanel0.gridwidth = 19;
        gbcPanel0.gridheight = 18;
        gbcPanel0.fill = GridBagConstraints.BOTH;
        gbcPanel0.weightx = 1;
        gbcPanel0.weighty = 1;
        gbcPanel0.anchor = GridBagConstraints.NORTH;
        JScrollPane scrollPane = new JScrollPane(taArea0);
        gbPanel0.setConstraints(scrollPane, gbcPanel0);
        pnPanel0.add(scrollPane);

        // Close button,
        btBut0 = new JButton(lang.getText("close"));
        gbcPanel0.gridx = 15;
        gbcPanel0.gridy = 18;
        gbcPanel0.gridwidth = 5;
        gbcPanel0.gridheight = 2;
        gbcPanel0.fill = GridBagConstraints.HORIZONTAL;
        gbcPanel0.weightx = 1;
        gbcPanel0.weighty = 0;
        gbcPanel0.anchor = GridBagConstraints.NORTH;
        gbPanel0.setConstraints(btBut0, gbcPanel0);
        pnPanel0.add(btBut0);

        // Next button
        btBut1 = new JButton(lang.getText("next"));
        gbcPanel0.gridx = 10;
        gbcPanel0.gridy = 18;
        gbcPanel0.gridwidth = 5;
        gbcPanel0.gridheight = 2;
        gbcPanel0.fill = GridBagConstraints.HORIZONTAL;
        gbcPanel0.weightx = 1;
        gbcPanel0.weighty = 0;
        gbcPanel0.anchor = GridBagConstraints.NORTH;
        gbPanel0.setConstraints(btBut1, gbcPanel0);
        pnPanel0.add(btBut1);

        // Back button
        btBut2 = new JButton(lang.getText("back"));
        gbcPanel0.gridx = 5;
        gbcPanel0.gridy = 18;
        gbcPanel0.gridwidth = 5;
        gbcPanel0.gridheight = 2;
        gbcPanel0.fill = GridBagConstraints.HORIZONTAL;
        gbcPanel0.weightx = 1;
        gbcPanel0.weighty = 0;
        gbcPanel0.anchor = GridBagConstraints.NORTH;
        gbPanel0.setConstraints(btBut2, gbcPanel0);
        pnPanel0.add(btBut2);

        // Checkbox for open in the futur on startup ??
        cbBox0 = new JCheckBox(lang.getText("showTipsOnStartup"), tips);
        gbcPanel0.gridx = 0;
        gbcPanel0.gridy = 18;
        gbcPanel0.gridwidth = 5;
        gbcPanel0.gridheight = 1;
        gbcPanel0.fill = GridBagConstraints.HORIZONTAL;
        gbcPanel0.weightx = 1;
        gbcPanel0.weighty = 0;
        gbcPanel0.anchor = GridBagConstraints.NORTH;
        gbPanel0.setConstraints(cbBox0, gbcPanel0);
        pnPanel0.add(cbBox0);

        setDefaultCloseOperation(DISPOSE_ON_CLOSE);

        JPanel mainPanel = new JPanel(new FlowLayout());
        mainPanel.add(pnPanel0);

        setContentPane(mainPanel);

        // Listener for close event
        btBut0.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
                dispose();
                appli.getOptions().setOpenTips(cbBox0.isSelected());
            }
        });

        btBut1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                index = (index + 1) % tipsText.length;
                changeText(tipsText[index]);
            }
        });

        btBut2.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                index--;
                if (index == -1)
                    index = tipsText.length - 1;
                changeText(tipsText[index]);
            }
        });

        this.pack();
        setResizable(false);
        DialogAligner.center(this, getParent());
        applyComponentOrientation(lang.getComponentOrientation());

    }
View Full Code Here

        GanttCalendar cal = new GanttCalendar(area.getViewState()
                .getStartDate());

        DefaultMutableTreeNode node = tree.getSelectedNode();
        GanttLanguage lang = GanttLanguage.getInstance();
        String nameOfTask = options.getTaskNamePrefix(); // language.getText("newTask");
        // if (current != null) {
        // current.setMilestone(false);
        // node = (TaskNode) tree.getSelectedNode();
        // cal = current.getStart();
View Full Code Here

    public ImportResources(ResourceManager resourceManager,
            TaskManager taskManager, RoleManager roleManager,
            GanttProject project) {
        myTaskManager = taskManager;
        myRoleManager = roleManager;
        GanttLanguage language = GanttLanguage.getInstance();

        this.putValue(AbstractAction.NAME, language.getText("importResources"));
        myResourceManager = resourceManager;

        URL iconUrl = this.getClass().getClassLoader().getResource(
                "icons/impres_16.gif");
        if (iconUrl != null) {
View Full Code Here

      next.rolesChanged(event);
    }
  }
   
    private void createRoleSet() {
        GanttLanguage language = GanttLanguage.getInstance();

        SOFTWARE_DEVELOPMENT_ROLE_SET.clear();
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language
                .getText("resDeveloper"), 2);
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language
                .getText("resDocWriter"), 3);
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language.getText("resTester"),
                4);
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language
                .getText("resGraphicDesigner"), 5);
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language
                .getText("resDocTranslator"), 6);
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language
                .getText("resPackager"), 7);
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language
                .getText("resAnalysis"), 8);
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language
                .getText("resWebDesigner"), 9);
        SOFTWARE_DEVELOPMENT_ROLE_SET.createRole(language
                .getText("resNoSpecificRole"), 10);
        DEFAULT_ROLE_SET.clear();
        DEFAULT_ROLE_SET.createRole(language.getText("resUndefined"), 0);
        DEFAULT_ROLE_SET.createRole(language.getText("resProjectManager"), 1);
        DEFAULT_ROLE_SET.setEnabled(true);
    }
View Full Code Here

        DEFAULT_ROLE_SET.createRole(language.getText("resProjectManager"), 1);
        DEFAULT_ROLE_SET.setEnabled(true);
    }
   
    private void changeRoleSet() {
        GanttLanguage language = GanttLanguage.getInstance();

        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language
                .getText("resDeveloper"), 2);
        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language
                .getText("resDocWriter"), 3);
        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language.getText("resTester"),
                4);
        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language
                .getText("resGraphicDesigner"), 5);
        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language
                .getText("resDocTranslator"), 6);
        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language
                .getText("resPackager"), 7);
        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language
                .getText("resAnalysis"), 8);
        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language
                .getText("resWebDesigner"), 9);
        SOFTWARE_DEVELOPMENT_ROLE_SET.changeRole(language
                .getText("resNoSpecificRole"), 10);
        DEFAULT_ROLE_SET.changeRole(language.getText("resUndefined"), 0);
        DEFAULT_ROLE_SET.changeRole(language.getText("resProjectManager"), 1);
    }
View Full Code Here

        final XMLBeansModel model = new XMLBeansModel(Factory.parse(is).getJbossesb());
       
        final List<Listener> awareListeners = model.getESBAwareListeners() ;
        assertEquals("Listener count", 1, awareListeners.size()) ;
       
        final Listener listener = awareListeners.get(0) ;
        assertTrue("JmsListener", listener instanceof JmsListener) ;
       
        final Document doc = YADOMUtil.createDocument() ;
        final Element root = doc.createElement("root") ;
        final Element listenerElement = JmsListenerMapper.map(root, (JmsListener)listener, model) ;
View Full Code Here

    JmsMessageFilter listenerDestination = awareListener.getJmsMessageFilter();
    assertEquals("queue/B", listenerDestination.getDestName());
    assertEquals(JmsMessageFilter.DestType.TOPIC, listenerDestination.getDestType());
    assertEquals("service='Reconciliation'", listenerDestination.getSelector());

    Listener untypedAwareListener = awareListeners.get(1);
    assertEquals("Bank-Listener-Generic", untypedAwareListener.getName());
    assertEquals("my-generic-bus", untypedAwareListener.getBusidref());
    assertTrue(!untypedAwareListener.getIsGateway());

    Service gatewayService = model.getService(gatewayListener);
    Service awareService = model.getService(awareListener);
    assertSame(gatewayService, awareService);
    assertEquals("Bank", awareService.getCategory());
View Full Code Here

        final XMLBeansModel model = new XMLBeansModel(Factory.parse(is).getJbossesb());
       
        final List<Listener> awareListeners = model.getESBAwareListeners() ;
        assertEquals("Listener count", 1, awareListeners.size()) ;
       
        final Listener listener = awareListeners.get(0) ;
        assertTrue("JmsListener", listener instanceof JmsListener) ;
       
        final Document doc = YADOMUtil.createDocument() ;
        final Element root = doc.createElement("root") ;
        final Element listenerElement = JmsListenerMapper.map(root, (JmsListener)listener, model) ;
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.language.GanttLanguage$Listener

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.