Ignore:
Timestamp:
03/15/11 20:13:29 (9 years ago)
Author:
aivar
Message:

Changed excitation to be autoranging. Modified (some) colors in synch with TRI2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-plugin/src/main/java/loci/slim/DecayGraph.java

    r7107 r7649  
    7676    static final Color DECAY_COLOR = Color.BLUE; 
    7777    static final Color FITTED_COLOR = Color.MAGENTA; 
     78    static final Color BACK_COLOR = Color.WHITE; 
     79    static final Color START_COLOR = Color.BLUE.darker(); 
     80    static final Color STOP_COLOR = Color.RED.darker(); 
     81    static final Color BASE_COLOR = Color.GREEN.darker(); 
    7882    JFrame m_frame; 
    7983    int m_start; 
     
    101105     * @param data fitted data 
    102106     */ 
    103     DecayGraph(final int start, final int stop, final int bins, final double timeInc, ICurveFitData data) { 
     107    DecayGraph(final String title, final int start, final int stop, final int bins, final double timeInc, ICurveFitData data) { 
    104108        m_start = start; 
    105109        m_stop = stop; 
     
    119123 
    120124        // create a frame for the chart 
    121         m_frame = new JFrame("Fitted Decay Curve"); 
     125        m_frame = new JFrame(title + " Fitted Decay Curve"); 
    122126        m_frame.getContentPane().add(layer); 
    123127        m_frame.setSize(450, 450); 
     
    221225        // create residual sub-plot 
    222226        NumberAxis residualAxis = new NumberAxis("Residual"); 
    223         residualAxis.setRange(-100.0, 100.0); 
     227        //TODO want to autorange it: residualAxis.setRange(-100.0, 100.0); 
    224228        XYSplineRenderer residualRenderer = new XYSplineRenderer(); 
    225229        residualRenderer.setSeriesShapesVisible(0, false); 
     
    373377 
    374378            // custom painting is here 
    375             g2.setXORMode(Color.MAGENTA); 
    376379            g2.setStroke(new BasicStroke(2f)); 
     380            g2.setXORMode(XORvalue(START_COLOR)); 
    377381            g2.drawLine(m_xStart, m_y0, m_xStart, m_y1); 
     382            g2.setXORMode(XORvalue(STOP_COLOR)); 
    378383            g2.drawLine(m_xStop, m_y0, m_xStop, m_y1); 
    379384        } 
     
    406411        } 
    407412 
     413        private Color XORvalue(Color color) { 
     414            int drawRGB = color.getRGB(); 
     415            int backRGB = BACK_COLOR.getRGB(); 
     416            return new Color(drawRGB ^ backRGB); 
     417        } 
     418 
    408419        /** 
    409420         * Gets the currently dragged horizontal value as a proportion, 
Note: See TracChangeset for help on using the changeset viewer.