| .. | .. | 
|---|
| 173 | 173 |          theRenderer = this; | 
|---|
| 174 | 174 |      } | 
|---|
| 175 | 175 |   | 
|---|
 | 176 | +    CameraPane(Object3D o, Camera cam, boolean withcontext)  | 
|---|
 | 177 | +    {  | 
|---|
 | 178 | +        super(defaultcaps, null, withcontext?glcontext:null, null);  | 
|---|
 | 179 | +  | 
|---|
 | 180 | +        //System.out.println("AMERICA AREA = " + (9458886 + 9210755 + 8480395  +  2736391  + 1943018 +  1289475 +  1141569  + 1069350 +  911559 +  721229 +  395886  + 377972 +   246700 +  211156  +  173985 +  141133  + 118279 +  112079 +  108523));  | 
|---|
 | 181 | +        glcontext = getContext();  | 
|---|
 | 182 | +  | 
|---|
 | 183 | +        cameras = new Camera[2];  | 
|---|
 | 184 | +        targetLookAts = new cVector[2];  | 
|---|
 | 185 | +  | 
|---|
 | 186 | +        SetCamera(cam);  | 
|---|
 | 187 | +  | 
|---|
 | 188 | +        SetLight(new Camera(new cVector(10, 10, -20)));  | 
|---|
 | 189 | +  | 
|---|
 | 190 | +        object = o;  | 
|---|
 | 191 | +  | 
|---|
 | 192 | +        setBackground(Color.white);  | 
|---|
 | 193 | +  | 
|---|
 | 194 | +        addKeyListener(this);  | 
|---|
 | 195 | +        addMouseListener(this);  | 
|---|
 | 196 | +        addMouseMotionListener(this);  | 
|---|
 | 197 | +        addMouseWheelListener(this);  | 
|---|
 | 198 | +        //System.out.println("addGLEventListener: " + this);  | 
|---|
 | 199 | +        addGLEventListener(this);  | 
|---|
 | 200 | +  | 
|---|
 | 201 | +//        pingthread.start(); // may 2013  | 
|---|
 | 202 | +    }  | 
|---|
 | 203 | +  | 
|---|
| 176 | 204 |      static boolean AntialiasingEnabled() | 
|---|
| 177 | 205 |      { | 
|---|
| 178 | 206 |          return CURRENTANTIALIAS > 0; | 
|---|
| .. | .. | 
|---|
| 672 | 700 |          //assert (cam.hAspect == 0); | 
|---|
| 673 | 701 |          cam.hAspect = 0; | 
|---|
| 674 | 702 |          lightCamera = cam; | 
|---|
| 675 |  | -    }  | 
|---|
| 676 |  | -  | 
|---|
| 677 |  | -    CameraPane(Object3D o, Camera cam, boolean withcontext)  | 
|---|
| 678 |  | -    {  | 
|---|
| 679 |  | -        super(defaultcaps, null, withcontext?glcontext:null, null);  | 
|---|
| 680 |  | -  | 
|---|
| 681 |  | -        //System.out.println("AMERICA AREA = " + (9458886 + 9210755 + 8480395  +  2736391  + 1943018 +  1289475 +  1141569  + 1069350 +  911559 +  721229 +  395886  + 377972 +   246700 +  211156  +  173985 +  141133  + 118279 +  112079 +  108523));  | 
|---|
| 682 |  | -        glcontext = getContext();  | 
|---|
| 683 |  | -  | 
|---|
| 684 |  | -        cameras = new Camera[2];  | 
|---|
| 685 |  | -        targetLookAts = new cVector[2];  | 
|---|
| 686 |  | -  | 
|---|
| 687 |  | -        SetCamera(cam);  | 
|---|
| 688 |  | -  | 
|---|
| 689 |  | -        SetLight(new Camera(new cVector(10, 10, -20)));  | 
|---|
| 690 |  | -  | 
|---|
| 691 |  | -        object = o;  | 
|---|
| 692 |  | -  | 
|---|
| 693 |  | -        setBackground(Color.white);  | 
|---|
| 694 |  | -  | 
|---|
| 695 |  | -        addKeyListener(this);  | 
|---|
| 696 |  | -        addMouseListener(this);  | 
|---|
| 697 |  | -        addMouseMotionListener(this);  | 
|---|
| 698 |  | -        addMouseWheelListener(this);  | 
|---|
| 699 |  | -        //System.out.println("addGLEventListener: " + this);  | 
|---|
| 700 |  | -        addGLEventListener(this);  | 
|---|
| 701 |  | -  | 
|---|
| 702 |  | -//        pingthread.start(); // may 2013  | 
|---|
| 703 | 703 |      } | 
|---|
| 704 | 704 |   | 
|---|
| 705 | 705 |      private static void ApplyTransform(GL gl, Mat4f xform) | 
|---|
 
| .. | .. | 
|---|
| 7 | 7 |   | 
|---|
| 8 | 8 |  public interface Constants | 
|---|
| 9 | 9 |  { | 
|---|
| 10 |  | -  | 
|---|
| 11 | 10 |      //public static final double pi = math.PI; | 
|---|
| 12 | 11 |      //public static final double radian = 0.01745329; | 
|---|
| 13 | 12 |      public static final String EOL = System.getProperty("line.separator"); | 
|---|
| .. | .. | 
|---|
| 15 | 14 |      public static final String imageTypes[] = { | 
|---|
| 16 | 15 |          "gif", "tga", "iff", "ppm", "pgm", "png", "jpeg", "tiff", "sys", "jpg" | 
|---|
| 17 | 16 |      }; | 
|---|
 | 17 | +      | 
|---|
| 18 | 18 |      public static final int beigeTheme[][] = { | 
|---|
| 19 | 19 |          { | 
|---|
| 20 | 20 |              104, 95, 90 | 
|---|
| .. | .. | 
|---|
| 34 | 34 |              255, 255, 255 | 
|---|
| 35 | 35 |          } | 
|---|
| 36 | 36 |      }; | 
|---|
| 37 |  | -  | 
|---|
 | 37 | +    public static final int yellowTheme[][] = {  | 
|---|
 | 38 | +        {  | 
|---|
 | 39 | +            104, 95, 90  | 
|---|
 | 40 | +        }, {  | 
|---|
 | 41 | +            164, 150, 145 //  | 
|---|
 | 42 | +        }, {  | 
|---|
 | 43 | +            204, 190, 185  | 
|---|
 | 44 | +        }, {  | 
|---|
 | 45 | +            111, 111, 111  | 
|---|
 | 46 | +        }, {  | 
|---|
 | 47 | +            163, 159, 159  | 
|---|
 | 48 | +        }, {  | 
|---|
 | 49 | +            //240, 226, 200 //  | 
|---|
 | 50 | +            240, 226, 200 //  | 
|---|
 | 51 | +        }, {  | 
|---|
 | 52 | +            0, 0, 0  | 
|---|
 | 53 | +        }, {  | 
|---|
 | 54 | +            255, 255, 255  | 
|---|
 | 55 | +        }  | 
|---|
 | 56 | +    };  | 
|---|
| 38 | 57 |  } | 
|---|
 
| .. | .. | 
|---|
| 742 | 742 |          try | 
|---|
| 743 | 743 |          { | 
|---|
| 744 | 744 |              MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme()); | 
|---|
| 745 |  | -            //MetalLookAndFeel.setCurrentTheme(new Theme(Constants.beigeTheme));  | 
|---|
 | 745 | +            MetalLookAndFeel.setCurrentTheme(new Theme(Constants.yellowTheme));  | 
|---|
| 746 | 746 |              UIManager.setLookAndFeel(new MetalLookAndFeel()); | 
|---|
 | 747 | +            //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");  | 
|---|
 | 748 | +            //UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel");  | 
|---|
 | 749 | +            //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");  | 
|---|
| 747 | 750 |          } catch (Exception e) | 
|---|
| 748 | 751 |          { | 
|---|
| 749 | 752 |          } | 
|---|
 
| .. | .. | 
|---|
| 31 | 31 |          boolean timeline; | 
|---|
| 32 | 32 |          boolean wasFullScreen; | 
|---|
| 33 | 33 |   | 
|---|
 | 34 | +    GroupEditor callee;  | 
|---|
 | 35 | +    JFrame frame;  | 
|---|
 | 36 | +      | 
|---|
| 34 | 37 |      // SCRIPT | 
|---|
| 35 | 38 |       | 
|---|
| 36 | 39 |      transient JFrame textpanel = null; | 
|---|
| .. | .. | 
|---|
| 127 | 130 |   | 
|---|
| 128 | 131 |      static GridBagConstraints aConstraints; | 
|---|
| 129 | 132 |      static GridBagConstraints aWindowConstraints; | 
|---|
| 130 |  | -    GroupEditor callee;  | 
|---|
| 131 |  | -    JFrame frame;  | 
|---|
 | 133 | +  | 
|---|
| 132 | 134 |      static int GRIDWIDTH = 100; // 4; | 
|---|
| 133 | 135 |   | 
|---|
| 134 | 136 |      public void closeUI() | 
|---|
| .. | .. | 
|---|
| 1369 | 1371 |          //worldPane.add(bigPanel); | 
|---|
| 1370 | 1372 |          //worldPane.add(worldPanel); | 
|---|
| 1371 | 1373 |                  /**/ | 
|---|
| 1372 |  | -        frame.getContentPane().add(/*"Center",*/framePanel);  | 
|---|
 | 1374 | +        //frame.getContentPane().add(/*"Center",*/framePanel);  | 
|---|
 | 1375 | +        frame.add(/*"Center",*/framePanel);  | 
|---|
| 1373 | 1376 |          //frame.getContentPane().add(/*"Center",*/ worldPane); | 
|---|
| 1374 | 1377 |   | 
|---|
| 1375 | 1378 |  //            aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); | 
|---|
 
| .. | .. | 
|---|
| 7 | 7 |  import java.awt.*; | 
|---|
| 8 | 8 |  import java.awt.event.*; | 
|---|
| 9 | 9 |   | 
|---|
 | 10 | +public class AddFieldPanel extends JPanel  | 
|---|
 | 11 | +{  | 
|---|
 | 12 | +        public JTextField name = new JTextField(12);  | 
|---|
 | 13 | +        public JComboBox typeChoices = new JComboBox();  | 
|---|
| 10 | 14 |   | 
|---|
| 11 |  | -public class AddFieldPanel extends JPanel {  | 
|---|
| 12 |  | -	public JTextField name=new JTextField(12);  | 
|---|
| 13 |  | -	public JComboBox typeChoices=new JComboBox();  | 
|---|
| 14 |  | -	public AddFieldPanel()  | 
|---|
| 15 |  | -	{  | 
|---|
| 16 |  | -		for (String choice: FieldFormatCatalog.classNames())  | 
|---|
| 17 |  | -			typeChoices.addItem(choice);  | 
|---|
| 18 |  | -		setLayout(new GridLayout(2,2));  | 
|---|
| 19 |  | -		add(new JLabel("Field Name"));  | 
|---|
| 20 |  | -		add(name);  | 
|---|
| 21 |  | -		add(new JLabel("Field Type"));  | 
|---|
| 22 |  | -		add(typeChoices);  | 
|---|
| 23 |  | -	}  | 
|---|
 | 15 | +        public AddFieldPanel()  | 
|---|
 | 16 | +        {  | 
|---|
 | 17 | +                for (String choice : FieldFormatCatalog.classNames())  | 
|---|
 | 18 | +                {  | 
|---|
 | 19 | +                        typeChoices.addItem(choice);  | 
|---|
 | 20 | +                }  | 
|---|
 | 21 | +                setLayout(new GridLayout(2, 2));  | 
|---|
 | 22 | +                add(new JLabel("Field Name"));  | 
|---|
 | 23 | +                add(name);  | 
|---|
 | 24 | +                add(new JLabel("Field Type"));  | 
|---|
 | 25 | +                add(typeChoices);  | 
|---|
 | 26 | +        }  | 
|---|
| 24 | 27 |  } | 
|---|
 
| .. | .. | 
|---|
| 43 | 43 |   | 
|---|
| 44 | 44 |          public ArrayDB(String[] fieldNames, Class[] types, String source) | 
|---|
| 45 | 45 |          { | 
|---|
| 46 |  | -                this.schema = new Schema();  | 
|---|
 | 46 | +                this.schema = new Schema(false);  | 
|---|
| 47 | 47 |                  this.source = source; | 
|---|
| 48 | 48 |                  int n = fieldNames.length; | 
|---|
| 49 | 49 |                  fields = new Field[n]; | 
|---|
 
| .. | .. | 
|---|
| 29 | 29 |   | 
|---|
| 30 | 30 |  	public BasicDB(String source) | 
|---|
| 31 | 31 |  	{ | 
|---|
| 32 |  | -		this(new Schema(), source);  | 
|---|
 | 32 | +		this(new Schema(true), source);  | 
|---|
| 33 | 33 |  	} | 
|---|
| 34 | 34 |  	 | 
|---|
| 35 | 35 |  	public BasicDB(Schema schema, String source) | 
|---|
 
| .. | .. | 
|---|
| 1 | 1 |  package timeflow.data.db; | 
|---|
 | 2 | +import timeflow.data.time.RoughTime;  | 
|---|
| 2 | 3 |   | 
|---|
| 3 | 4 |  import java.util.*; | 
|---|
| 4 | 5 |   | 
|---|
| .. | .. | 
|---|
| 6 | 7 |  public class Schema implements Iterable<Field> | 
|---|
| 7 | 8 |  { | 
|---|
| 8 | 9 |   | 
|---|
 | 10 | +        public Schema(boolean withDateField)  | 
|---|
 | 11 | +        {  | 
|---|
 | 12 | +                add(new Field("Time", RoughTime.class, 0));  | 
|---|
 | 13 | +                add(new Field("Name", String.class, 0));  | 
|---|
 | 14 | +        }  | 
|---|
 | 15 | +          | 
|---|
| 9 | 16 |          private Map<String, Field> schema = new HashMap<String, Field>(); | 
|---|
| 10 | 17 |          private List<Field> fieldList = new ArrayList<Field>(); // so we preserve field order. | 
|---|
| 11 | 18 |   | 
|---|
 
| .. | .. | 
|---|
| 13 | 13 |          public static final TimeUnit HOUR = new TimeUnit("Hours", Calendar.HOUR_OF_DAY, 60 * 60 * 1000L, "HH:mm", "MMM d yyyy HH:mm"); | 
|---|
| 14 | 14 |          public static final TimeUnit MINUTE = new TimeUnit("Minutes", Calendar.MINUTE, 60 * 1000L, ":mm", "MMM d yyyy HH:mm"); | 
|---|
| 15 | 15 |          public static final TimeUnit SECOND = new TimeUnit("Seconds", Calendar.SECOND, 1000L, ":ss", "MMM d yyyy HH:mm:ss"); | 
|---|
| 16 |  | -        public static final TimeUnit REALTIME = new TimeUnit("Realtime", Calendar.MILLISECOND, 1L, ":SS", "HH:mm:ss.SS");  | 
|---|
 | 16 | +        public static final TimeUnit REALTIME = new TimeUnit("Realtime", Calendar.MILLISECOND, 1L, ".SS", "HH:mm:ss.SS");  | 
|---|
| 17 | 17 |           | 
|---|
| 18 | 18 |          public static final TimeUnit DECADE = multipleYears(10); | 
|---|
| 19 | 19 |          public static final TimeUnit CENTURY = multipleYears(100); | 
|---|
| .. | .. | 
|---|
| 238 | 238 |   | 
|---|
| 239 | 239 |          public String format(Date date) | 
|---|
| 240 | 240 |          { | 
|---|
| 241 |  | -                return format.format(date);  | 
|---|
 | 241 | +               return format.format(date);  | 
|---|
| 242 | 242 |          } | 
|---|
| 243 | 243 |   | 
|---|
| 244 | 244 |          public String formatFull(Date date) | 
|---|
 
| .. | .. | 
|---|
| 49 | 49 |  //		parsers.add(new DateTimeParser("MMM/dd/yyyy HH:mm", TimeUnit.SECOND)); | 
|---|
| 50 | 50 |  //		parsers.add(new DateTimeParser("MM/dd/yy HH:mm", TimeUnit.SECOND)); | 
|---|
| 51 | 51 |  //		parsers.add(new DateTimeParser("MMM dd yyyy HH:mm:ss", TimeUnit.SECOND)); | 
|---|
| 52 |  | -		parsers.add(new DateTimeParser("HH:mm:ss:SS", TimeUnit.REALTIME));  | 
|---|
 | 52 | +		parsers.add(new DateTimeParser("HH:mm:ss.SS", TimeUnit.REALTIME));  | 
|---|
| 53 | 53 |  //		parsers.add(new DateTimeParser("MM/dd/yyyy HH:mm:ss", TimeUnit.SECOND)); | 
|---|
| 54 | 54 |  //		parsers.add(new DateTimeParser("MMM dd yyyy HH:mm:ss zzzzzzzz", TimeUnit.SECOND)); | 
|---|
| 55 | 55 |  //		parsers.add(new DateTimeParser("EEE MMM dd HH:mm:ss zzzzzzzz yyyy", TimeUnit.SECOND)); | 
|---|
 
| .. | .. | 
|---|
| 6 | 6 |  import java.net.URL; | 
|---|
| 7 | 7 |  import java.util.*; | 
|---|
| 8 | 8 |   | 
|---|
| 9 |  | -public class FieldFormatCatalog {  | 
|---|
 | 9 | +public class FieldFormatCatalog  | 
|---|
 | 10 | +{  | 
|---|
 | 11 | +        private static Map<String, FieldFormat> formatTable = new HashMap<String, FieldFormat>();  | 
|---|
 | 12 | +        private static Map<Class, FieldFormat> classTable = new HashMap<Class, FieldFormat>();  | 
|---|
| 10 | 13 |   | 
|---|
| 11 |  | -	private static Map<String, FieldFormat> formatTable=new HashMap<String, FieldFormat>();  | 
|---|
| 12 |  | -	private static Map<Class, FieldFormat> classTable=new HashMap<Class, FieldFormat>();  | 
|---|
 | 14 | +        static  | 
|---|
 | 15 | +        {  | 
|---|
 | 16 | +                for (FieldFormat f : listFormats())  | 
|---|
 | 17 | +                {  | 
|---|
 | 18 | +                        formatTable.put(f.getHumanName(), f);  | 
|---|
 | 19 | +                        classTable.put(f.getType(), f);  | 
|---|
 | 20 | +                }  | 
|---|
 | 21 | +        }  | 
|---|
| 13 | 22 |   | 
|---|
| 14 |  | -	static  | 
|---|
| 15 |  | -	{  | 
|---|
| 16 |  | -		for (FieldFormat f: listFormats())  | 
|---|
| 17 |  | -		{  | 
|---|
| 18 |  | -			formatTable.put(f.getHumanName(), f);  | 
|---|
| 19 |  | -			classTable.put(f.getType(), f);  | 
|---|
| 20 |  | -		}  | 
|---|
| 21 |  | -	}  | 
|---|
| 22 |  | -	  | 
|---|
| 23 |  | -	static FieldFormat[] listFormats()  | 
|---|
| 24 |  | -	{  | 
|---|
| 25 |  | -		return new FieldFormat[] {new FormatDateTime(), new FormatString(),  | 
|---|
| 26 |  | -				new FormatStringArray(), new FormatDouble(), new FormatURL()};  | 
|---|
| 27 |  | -	}  | 
|---|
| 28 |  | -	  | 
|---|
| 29 |  | -	public static Iterable<String> classNames()  | 
|---|
| 30 |  | -	{  | 
|---|
| 31 |  | -		return formatTable.keySet();  | 
|---|
| 32 |  | -	}  | 
|---|
| 33 |  | -	  | 
|---|
| 34 |  | -	public static String humanName(Class c){  | 
|---|
| 35 |  | -		return getFormat(c).getHumanName();  | 
|---|
| 36 |  | -	}  | 
|---|
| 37 |  | -	  | 
|---|
 | 23 | +        static FieldFormat[] listFormats()  | 
|---|
 | 24 | +        {  | 
|---|
 | 25 | +                return new FieldFormat[]  | 
|---|
 | 26 | +                        {  | 
|---|
 | 27 | +                                new FormatDateTime(), new FormatString(),  | 
|---|
 | 28 | +                                new FormatStringArray(), new FormatDouble(), new FormatURL()  | 
|---|
 | 29 | +                        };  | 
|---|
 | 30 | +        }  | 
|---|
| 38 | 31 |   | 
|---|
| 39 |  | -	public static FieldFormat getFormat(Class c) {  | 
|---|
| 40 |  | -		FieldFormat f= classTable.get(c);  | 
|---|
| 41 |  | -		if (f==null)  | 
|---|
| 42 |  | -			System.out.println("Warning: no FieldFormat for "+c);  | 
|---|
| 43 |  | -		return f;  | 
|---|
| 44 |  | -	}  | 
|---|
 | 32 | +        public static Iterable<String> classNames()  | 
|---|
 | 33 | +        {  | 
|---|
 | 34 | +                return formatTable.keySet();  | 
|---|
 | 35 | +        }  | 
|---|
| 45 | 36 |   | 
|---|
| 46 |  | -	  | 
|---|
| 47 |  | -	public static Class javaClass(String humanName)  | 
|---|
| 48 |  | -	{  | 
|---|
| 49 |  | -		Class  c=formatTable.get(humanName).getType();  | 
|---|
| 50 |  | -		if (c==null)  | 
|---|
| 51 |  | -			System.out.println("Warning: no class for "+humanName);  | 
|---|
| 52 |  | -		return c;  | 
|---|
| 53 |  | -	}  | 
|---|
 | 37 | +        public static String humanName(Class c)  | 
|---|
 | 38 | +        {  | 
|---|
 | 39 | +                return getFormat(c).getHumanName();  | 
|---|
 | 40 | +        }  | 
|---|
 | 41 | +  | 
|---|
 | 42 | +        public static FieldFormat getFormat(Class c)  | 
|---|
 | 43 | +        {  | 
|---|
 | 44 | +                FieldFormat f = classTable.get(c);  | 
|---|
 | 45 | +                if (f == null)  | 
|---|
 | 46 | +                {  | 
|---|
 | 47 | +                        System.out.println("Warning: no FieldFormat for " + c);  | 
|---|
 | 48 | +                }  | 
|---|
 | 49 | +                return f;  | 
|---|
 | 50 | +        }  | 
|---|
 | 51 | +  | 
|---|
 | 52 | +        public static Class javaClass(String humanName)  | 
|---|
 | 53 | +        {  | 
|---|
 | 54 | +                Class c = formatTable.get(humanName).getType();  | 
|---|
 | 55 | +                if (c == null)  | 
|---|
 | 56 | +                {  | 
|---|
 | 57 | +                        System.out.println("Warning: no class for " + humanName);  | 
|---|
 | 58 | +                }  | 
|---|
 | 59 | +                return c;  | 
|---|
 | 60 | +        }  | 
|---|
| 54 | 61 |  } | 
|---|
 
| .. | .. | 
|---|
| 87 | 87 |                  colors.put("timeline.unspecified.color", new Color(0, 53, 153)); | 
|---|
| 88 | 88 |                  colors.put("highlight.color", new Color(0, 53, 153)); | 
|---|
| 89 | 89 |   | 
|---|
| 90 |  | -                ints.put("timeline.datelabel.height", 20);  | 
|---|
 | 90 | +                ints.put("timeline.datelabel.height", 10);  | 
|---|
| 91 | 91 |                  ints.put("timeline.item.height.min", 16); | 
|---|
| 92 | 92 |          } | 
|---|
| 93 | 93 |   | 
|---|
 
| .. | .. | 
|---|
| 5 | 5 |  import timeflow.data.db.DBUtils; | 
|---|
| 6 | 6 |  import timeflow.data.time.*; | 
|---|
| 7 | 7 |  import timeflow.model.*; | 
|---|
 | 8 | +  | 
|---|
| 8 | 9 |  //import timeflow.views.CalendarView.CalendarPanel; | 
|---|
| 9 | 10 |  //import timeflow.views.CalendarView.ScrollingCalendar; | 
|---|
| 10 | 11 |  import timeflow.vis.Mouseover; | 
|---|
| .. | .. | 
|---|
| 40 | 41 |          public TimelineView(TimeflowModel model) | 
|---|
| 41 | 42 |          { | 
|---|
| 42 | 43 |                  super(model); | 
|---|
 | 44 | +                  | 
|---|
| 43 | 45 |                  visuals = new TimelineVisuals(model); | 
|---|
| 44 | 46 |                  grid = new AxisRenderer(visuals); | 
|---|
| 45 | 47 |                  timeline = new TimelineRenderer(visuals); | 
|---|
| .. | .. | 
|---|
| 55 | 57 |   | 
|---|
| 56 | 58 |                  TimelineSlider slider = new TimelineSlider(visuals, 24 * 60 * 60 * 1000L, new Runnable() | 
|---|
| 57 | 59 |                  { | 
|---|
| 58 |  | -  | 
|---|
| 59 | 60 |                          @Override | 
|---|
| 60 | 61 |                          public void run() | 
|---|
| 61 | 62 |                          { | 
|---|
| 62 | 63 |                                  redraw(); | 
|---|
| 63 | 64 |                          } | 
|---|
| 64 | 65 |                  }); | 
|---|
 | 66 | +                  | 
|---|
| 65 | 67 |                  bottom.add(slider, BorderLayout.CENTER); | 
|---|
| 66 | 68 |   | 
|---|
| 67 | 69 |                  controls = new JPanel(); | 
|---|
| .. | .. | 
|---|
| 70 | 72 |   | 
|---|
| 71 | 73 |                  // top part of grid: zoom buttons. | 
|---|
| 72 | 74 |                  ComponentCluster buttons = new ComponentCluster("Zoom"); | 
|---|
 | 75 | +                  | 
|---|
| 73 | 76 |                  //ImageIcon zoomOutIcon = new ImageIcon("images/zoom_out.gif"); | 
|---|
| 74 | 77 |                  JButton zoomIn = new JButton("In 1/2X"); | 
|---|
| 75 | 78 |                  buttons.addContent(zoomIn); | 
|---|
 
| .. | .. | 
|---|
| 57 | 57 |                          g.setColor(t.unit.isDayOrLess() && (dayOfWeek == 1 || dayOfWeek == 7) | 
|---|
| 58 | 58 |                                  ? new Color(245, 245, 245) : new Color(240, 240, 240)); | 
|---|
| 59 | 59 |   | 
|---|
| 60 |  | -                        g.fillRect(x0, y, x1 - x0 - 1, h);  | 
|---|
 | 60 | +                        g.fillRect(x0, y, x1 - x0, h);  | 
|---|
| 61 | 61 |                          g.setColor(Color.white); | 
|---|
| 62 |  | -                        g.drawLine(x1 - 1, y, x1 - 1, y + h);  | 
|---|
 | 62 | +                        g.drawLine(x1, y, x1, y + h);  | 
|---|
| 63 | 63 |                          g.drawLine(x0, y + h, x1, y + h); | 
|---|
| 64 |  | -                        objectLocations.add(new Mouseover(new Interval(start, end), x0, y, x1 - x0 - 1, h));  | 
|---|
 | 64 | +                        objectLocations.add(new Mouseover(new Interval(start, end), x0, y, x1 - x0, h));  | 
|---|
| 65 | 65 |   | 
|---|
| 66 | 66 |                          g.setFont(model.getDisplay().timeLabel()); | 
|---|
| 67 | 67 |                          String label = full ? t.unit.formatFull(start) : t.unit.format(new Date(start)); | 
|---|
| 68 |  | -                        int tx = x0 + 3;  | 
|---|
| 69 |  | -                        int ty = y + h - 5;  | 
|---|
 | 68 | +                          | 
|---|
 | 69 | +                        if (!full)  | 
|---|
 | 70 | +                                full = false;  | 
|---|
 | 71 | +                          | 
|---|
 | 72 | +                        int tx = x0;  | 
|---|
 | 73 | +                        int ty = y + h;  | 
|---|
| 70 | 74 |                          g.setColor(full ? Color.darkGray : Color.gray); | 
|---|
| 71 | 75 |                          int sw = model.getDisplay().timeLabelFontMetrics().stringWidth(label); | 
|---|
| 72 |  | -                        if (sw < x1 - tx - 3)  | 
|---|
 | 76 | +                        if (true) // sw < x1 - tx)  | 
|---|
| 73 | 77 |                          { | 
|---|
| 74 | 78 |                                  g.drawString(label, tx, ty); | 
|---|
| 75 | 79 |                          } else | 
|---|
| .. | .. | 
|---|
| 79 | 83 |                                  { | 
|---|
| 80 | 84 |                                          label = label.substring(0, c); | 
|---|
| 81 | 85 |                                          sw = model.getDisplay().timeLabelFontMetrics().stringWidth(label); | 
|---|
| 82 |  | -                                        if (sw < x1 - tx - 3)  | 
|---|
 | 86 | +                                        //if (sw < x1 - tx)  | 
|---|
| 83 | 87 |                                          { | 
|---|
| 84 | 88 |                                                  g.drawString(label, tx, ty); | 
|---|
| 85 | 89 |                                          } | 
|---|
 
| .. | .. | 
|---|
| 44 | 44 |   | 
|---|
| 45 | 45 |          public static List<AxisTicMarks> allRelevant(long start, long end) | 
|---|
| 46 | 46 |          { | 
|---|
| 47 |  | -                return allRelevant(start, end, 40);  | 
|---|
 | 47 | +                return allRelevant(start, end, 4000);  | 
|---|
| 48 | 48 |          } | 
|---|
| 49 | 49 |   | 
|---|
| 50 | 50 |          public static AxisTicMarks histoTics(long start, long end) | 
|---|
| .. | .. | 
|---|
| 68 | 68 |          public static List<AxisTicMarks> allRelevant(long start, long end, long maxTics) | 
|---|
| 69 | 69 |          { | 
|---|
| 70 | 70 |                  List<AxisTicMarks> list = new ArrayList<AxisTicMarks>(); | 
|---|
| 71 |  | -  | 
|---|
| 72 | 71 |   | 
|---|
| 73 | 72 |                  for (int i = 0; i < units.length; i++) | 
|---|
| 74 | 73 |                  { | 
|---|
 
| .. | .. | 
|---|
| 8 | 8 |   | 
|---|
| 9 | 9 |  public class TimelineTrack implements Comparable | 
|---|
| 10 | 10 |  { | 
|---|
| 11 |  | -  | 
|---|
| 12 | 11 |          String label; | 
|---|
| 13 | 12 |          List<VisualAct> visualActs = new ArrayList<VisualAct>(); | 
|---|
| 14 | 13 |          int y0, y1; | 
|---|
 
| .. | .. | 
|---|
| 15 | 15 |   */ | 
|---|
| 16 | 16 |  public class TimelineVisuals | 
|---|
| 17 | 17 |  { | 
|---|
| 18 |  | -  | 
|---|
| 19 | 18 |          private Map<String, TimelineTrack> trackTable = new HashMap<String, TimelineTrack>(); | 
|---|
| 20 | 19 |          ArrayList<TimelineTrack> trackList = new ArrayList<TimelineTrack>(); | 
|---|
 | 20 | +          | 
|---|
| 21 | 21 |          private TimeScale timeScale = new TimeScale(); | 
|---|
| 22 | 22 |          private Rectangle bounds = new Rectangle(); | 
|---|
| 23 | 23 |          private boolean frameChanged; | 
|---|