Search in sources :

Example 1 with JTimePanel

use of org.freeplane.view.swing.features.time.mindmapmode.TimeManagement.JTimePanel in project freeplane by freeplane.

the class ReminderHook method createTimePanel.

private void createTimePanel() {
    final TimeManagement timeManagement = new TimeManagement(this);
    final int axis = BoxLayout.Y_AXIS;
    final JTimePanel timePanel = timeManagement.createTimePanel(null, false, 1);
    modeController.getMapController().addNodeSelectionListener(new INodeSelectionListener() {

        public void onSelect(NodeModel node) {
            timePanel.update(node);
        }

        public void onDeselect(NodeModel node) {
        }
    });
    modeController.getMapController().addNodeChangeListener(new INodeChangeListener() {

        public void nodeChanged(NodeChangeEvent event) {
            final NodeModel node = event.getNode();
            if (event.getProperty().equals(getExtensionClass()) && node.equals(modeController.getMapController().getSelectedNode()))
                timePanel.update(node);
        }
    });
    timePanel.setBorder(BorderFactory.createTitledBorder(TextUtils.getText("calendar_panel")));
    final JPanel tablePanel = new AttributePanelManager(modeController).getTablePanel();
    tablePanel.setBorder(BorderFactory.createTitledBorder(TextUtils.getText("attributes_attribute")));
    final Box panel = new Box(axis);
    panel.add(timePanel);
    panel.add(tablePanel);
    final JTabbedPane tabs = (JTabbedPane) modeController.getUserInputListenerFactory().getToolBar("/format").getComponent(1);
    final JScrollPane timeScrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    UITools.setScrollbarIncrement(timeScrollPane);
    tabs.add(TextUtils.getText("calendar_attributes_panel"), timeScrollPane);
}
Also used : NodeChangeEvent(org.freeplane.features.map.NodeChangeEvent) JScrollPane(javax.swing.JScrollPane) INodeSelectionListener(org.freeplane.features.map.INodeSelectionListener) JPanel(javax.swing.JPanel) NodeModel(org.freeplane.features.map.NodeModel) INodeChangeListener(org.freeplane.features.map.INodeChangeListener) JTabbedPane(javax.swing.JTabbedPane) AttributePanelManager(org.freeplane.view.swing.map.attribute.AttributePanelManager) Box(javax.swing.Box) JTimePanel(org.freeplane.view.swing.features.time.mindmapmode.TimeManagement.JTimePanel)

Aggregations

Box (javax.swing.Box)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JTabbedPane (javax.swing.JTabbedPane)1 INodeChangeListener (org.freeplane.features.map.INodeChangeListener)1 INodeSelectionListener (org.freeplane.features.map.INodeSelectionListener)1 NodeChangeEvent (org.freeplane.features.map.NodeChangeEvent)1 NodeModel (org.freeplane.features.map.NodeModel)1 JTimePanel (org.freeplane.view.swing.features.time.mindmapmode.TimeManagement.JTimePanel)1 AttributePanelManager (org.freeplane.view.swing.map.attribute.AttributePanelManager)1