Inheritance diagram for SlicesPanel::
Public Methods | |
SlicesPanel () | |
SlicesPanel (FrameNavigatorUser u) | |
SlicesPanel (FrameNavigatorUser u, int imWidth, int imHeight) | |
void | setUser (FrameNavigatorUser u) |
void | setImageSizes (int imWidth, int imHeight) |
void | paint (Graphics g) |
void | updateSegs (HxCorba.VxSegmentationOperations seg, Color col, File f) |
void | clearImage () |
boolean | imageUpdate (Image img, int infoflags, int x, int y, int width, int height) |
void | setCurrentFrame (int frameNr) |
void | setNumberOfFrames (int maxFrame) |
|
00024 { 00025 this(null, 10000, 280); 00026 } |
|
00029 { 00030 this(u, 10000, 280); 00031 } |
|
00034 { 00035 addMouseListener(new SlicesMouseListener()); 00036 00037 _curFrame = 0; 00038 _user = u; 00039 00040 setImageSizes(imWidth, imHeight); 00041 } |
|
Reimplemented from FrameNavigator.
00045 { 00046 _user = u; 00047 } |
|
00050 { 00051 _image = new BufferedImage(imWidth, imHeight, 00052 BufferedImage.TYPE_INT_RGB); 00053 _imWidth = imWidth; 00054 _imHeight = imHeight; 00055 Graphics2D imGraphics = _image.createGraphics(); 00056 imGraphics.setColor(Color.white); 00057 imGraphics.fillRect(0, 0, _imWidth, _imHeight); 00058 00059 setMinimumSize(new Dimension(_imWidth, _imHeight)); 00060 setPreferredSize(new Dimension(_imWidth, _imHeight)); 00061 00062 _curFrame = 0; 00063 00064 repaint(); 00065 } |
|
00068 { 00069 Graphics2D g2 = (Graphics2D) g; 00070 g.drawImage(_image, 0, 0, _imWidth, _imHeight, null); 00071 int fr = _curFrame % _imWidth; 00072 g.setColor(Color.red); 00073 g.drawLine(fr, 0, fr, _imHeight); 00074 } |
|
00077 { 00078 _times = seg.getTimeSpans(); 00079 _color = col; 00080 int dot = f.getPath().lastIndexOf('.'); 00081 _prefix = f.getPath().substring(0, dot); 00082 00083 updateSliceSet(0); 00084 } |
|
00087 { 00088 Graphics2D imGraphics = _image.createGraphics(); 00089 imGraphics.setColor(Color.white); 00090 imGraphics.fillRect(0, 0, _imWidth, _imHeight); 00091 00092 _curFrame = 0; 00093 00094 repaint(); 00095 } |
|
00099 { 00100 if((infoflags & ERROR) != 0) return true; 00101 00102 Graphics2D imGraphics = _image.createGraphics(); 00103 imGraphics.drawImage(_sliceIm, 0, 0, this); 00104 00105 if((infoflags & ALLBITS) == 0) return true; 00106 00107 imGraphics.setColor(_color); 00108 int start = 0; 00109 int index = 0; 00110 while((start < _imWidth) && (index < _times.length)) { 00111 start = _times[index].start - (_sliceSet * _imWidth); 00112 if(start >= 0) 00113 imGraphics.drawLine(start, 0, start, _imHeight); 00114 index++; 00115 } 00116 00117 repaint(); 00118 return true; 00119 } |
|
Reimplemented from FrameNavigator.
00123 { 00124 _curFrame = frameNr; 00125 00126 // is cur frame in another slice set? 00127 int dif = _curFrame - _sliceSet * _imWidth; 00128 if((dif < 0) || (dif >= _imWidth)) 00129 updateSliceSet(_curFrame / _imWidth); 00130 00131 // make sure curFrame is visible 00132 int pos = _curFrame % _imWidth; 00133 JViewport viewport = (JViewport)getParent(); 00134 Rectangle r = viewport.getViewRect(); 00135 if ((pos < r.x) || (pos > r.x + r.width)) { 00136 pos = pos - 10; 00137 if (pos < 0) 00138 pos = 0; 00139 viewport.setViewPosition(new Point(pos, 0)); 00140 } 00141 00142 repaint(); 00143 } |
|
Reimplemented from FrameNavigator.
00147 { 00148 } |