Package timeflow.app.ui

Examples of timeflow.app.ui.ComponentCluster


    add(scroller);
   
    controls=new JPanel();
    controls.setLayout(new BorderLayout());

    ComponentCluster units=new ComponentCluster("Grid");
    controls.add(units, BorderLayout.NORTH);
   
    ButtonGroup unitGroup=new ButtonGroup();
   
    JRadioButton days=new JRadioButton(new ImageIcon("images/button_days.gif"),true);
    days.setSelectedIcon(new ImageIcon("images/button_days_selected.gif"));
    units.addContent(days);
    days.addActionListener(new LayoutSetter(CalendarVisuals.Layout.DAY));
    unitGroup.add(days);

    JRadioButton months=new JRadioButton(new ImageIcon("images/button_months.gif"),false);
    months.setSelectedIcon(new ImageIcon("images/button_months_selected.gif"));
    units.addContent(months);
    months.addActionListener(new LayoutSetter(CalendarVisuals.Layout.MONTH));
    unitGroup.add(months);
   
    JRadioButton years=new JRadioButton(new ImageIcon("images/button_years.gif"),false);
    years.setSelectedIcon(new ImageIcon("images/button_years_selected.gif"));
    units.addContent(years);
    years.addActionListener(new LayoutSetter(CalendarVisuals.Layout.YEAR))
    unitGroup.add(years);
   
   
    ComponentCluster showCluster=new ComponentCluster("Show");
    controls.add(showCluster, BorderLayout.CENTER);
   
    ButtonGroup group=new ButtonGroup();
    JRadioButton icon=new JRadioButton(new ImageIcon("images/button_dots.gif"),true);
    icon.setSelectedIcon(new ImageIcon("images/button_dots_selected.gif"));
    showCluster.addContent(icon);
    icon.addActionListener(new DrawStyleSetter(CalendarVisuals.DrawStyle.ICON));
    group.add(icon);
   
    JRadioButton label=new JRadioButton(new ImageIcon("images/button_labels.gif"),false);
    label.setSelectedIcon(new ImageIcon("images/button_labels_selected.gif"));
    showCluster.addContent(label);
    label.addActionListener(new DrawStyleSetter(CalendarVisuals.DrawStyle.LABEL));           
    group.add(label);

    ComponentCluster layout=new ComponentCluster("Layout");
    controls.add(layout, BorderLayout.SOUTH);
   
    ButtonGroup layoutGroup=new ButtonGroup();
    JRadioButton loose=new JRadioButton(new ImageIcon("images/button_expanded.gif"),true);
    loose.setSelectedIcon(new ImageIcon("images/button_expanded_selected.gif"));
    layout.addContent(loose);
    loose.addActionListener(new FitStyleSetter(CalendarVisuals.FitStyle.LOOSE));
    layoutGroup.add(loose);
   
    JRadioButton tight=new JRadioButton(new ImageIcon("images/button_compressed.gif"),false);
    tight.setSelectedIcon(new ImageIcon("images/button_compressed_selected.gif"));
    layout.addContent(tight);
    tight.addActionListener(new FitStyleSetter(CalendarVisuals.FitStyle.TIGHT));
    layoutGroup.add(tight);
  }
View Full Code Here


    controls=new JPanel();
    controls.setBackground(Color.white);
    controls.setLayout(new BorderLayout());//new GridLayout(2,1));
   
    // top part of grid: zoom buttons.
    ComponentCluster buttons=new ComponentCluster("Zoom");
    ImageIcon zoomOutIcon=new ImageIcon("images/zoom_out.gif");
    JButton zoomOut=new JButton(zoomOutIcon);
    buttons.addContent(zoomOut);
    zoomOut.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        Interval zoom=visuals.getViewInterval().subinterval(-1, 2).intersection(visuals.getGlobalInterval());
        moveTime(zoom);
      }});
   
    ImageIcon zoomOut100Icon=new ImageIcon("images/zoom_out_100.gif");
    JButton zoomOutAll=new JButton(zoomOut100Icon);
    buttons.addContent(zoomOutAll);
    zoomOutAll.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        moveTime(visuals.getGlobalInterval());
      }});
   
    /*
    // UI for zooming to precisely fit the visible selection.
    // No one seemed to think this was so important, but we may want it again some day.
    // if you uncomment this, then also uncomment the line in reset().
    ImageIcon zoomSelection=new ImageIcon("images/zoom_selection.gif");
    fit=new JButton(zoomSelection);
    fit.setBackground(Color.white);
    buttons.addContent(fit);
    fit.setEnabled(false);
    fit.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        moveTime(visuals.getFitToVisibleRange());
      }});
      */
    controls.add(buttons, BorderLayout.NORTH);
   
    // ok, now do second part of grid: layout style buttons.
    ComponentCluster layoutPanel=new ComponentCluster("Layout");
   
    ButtonGroup layoutGroup=new ButtonGroup();
    ImageIcon looseIcon=new ImageIcon("images/layout_loose.gif");
    JRadioButton loose=new JRadioButton(looseIcon, true);
    loose.setSelectedIcon(new ImageIcon("images/layout_loose_selected.gif"));
    layoutPanel.addContent(loose);
    loose.addActionListener(new LayoutSetter(TimelineVisuals.Layout.LOOSE));
    layoutGroup.add(loose);
   
    ImageIcon diagonalIcon=new ImageIcon("images/layout_diagonal.gif");
    JRadioButton diagonal=new JRadioButton(diagonalIcon, false);
    diagonal.setSelectedIcon(new ImageIcon("images/layout_diagonal_selected.gif"));
    layoutPanel.addContent(diagonal);
    diagonal.addActionListener(new LayoutSetter(TimelineVisuals.Layout.TIGHT));
    layoutGroup.add(diagonal);
   
    ImageIcon graphIcon=new ImageIcon("images/layout_graph.gif");
    JRadioButton graph=new JRadioButton(graphIcon, false);
    graph.setSelectedIcon(new ImageIcon("images/layout_graph_selected.gif"));
    layoutPanel.addContent(graph);
    graph.addActionListener(new LayoutSetter(TimelineVisuals.Layout.GRAPH));
    layoutGroup.add(graph);
   
    controls.add(layoutPanel, BorderLayout.CENTER);
  }
View Full Code Here

TOP

Related Classes of timeflow.app.ui.ComponentCluster

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.