|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--trex.GUI.HistoPanel
This class provides a panel for (possibly two concurrent) histograms of ImageIcons.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
static int |
CHANNEL_BLUE
Display Histogram for blue channel |
static int |
CHANNEL_GREEN
Display Histogram for green channel |
static int |
CHANNEL_RED
Display Histogram for red channel |
static int |
CHANNEL_VALUE
Display Histogram for value |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
HistoPanel(Frame parent,
ImageIcon img1,
ImageIcon img2,
Color color1,
Color color2,
String colExpl,
int height,
int channel)
Constructor. |
Method Summary | |
protected static int[] |
collectBins(Frame parent,
ImageIcon img,
int channel)
Grab pixels from image and create histogram bins. |
protected static int[] |
collectBins(int[] pixels,
int channel)
Create histogram bins. |
static ImageIcon |
createHisto(Frame parent,
ImageIcon img,
int border,
int height,
Color color,
int channel)
Create the actual histogram image. |
void |
setImg1(ImageIcon img)
Set image1. |
void |
setImg2(ImageIcon img)
Set image2. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CHANNEL_VALUE
public static final int CHANNEL_RED
public static final int CHANNEL_GREEN
public static final int CHANNEL_BLUE
Constructor Detail |
public HistoPanel(Frame parent, ImageIcon img1, ImageIcon img2, Color color1, Color color2, String colExpl, int height, int channel)
parent
- Parent window (for message boxes).img1
- First image to draw histogram for.img2
- Second image to draw histogram for.color1
- Color of first histogram.color2
- Color of second histogram.colExpl
- Text string to inform user of color uses.height
- Image height.channel
- The channel to draw histogram for (CHANNEL_VALUE, CHANNEL_RED, CHANNEL_GREEN or CHANNEL_BLUE).Method Detail |
protected static int[] collectBins(int[] pixels, int channel)
pixels
- Pixel data.channel
- Channel to display (CHANNEL_VALUE, CHANNEL_RED, CHANNEL_GREEN or CHANNEL_BLUE).
protected static int[] collectBins(Frame parent, ImageIcon img, int channel)
collectBins(int[], int)
.
parent
- Parent window.img
- Image to grab pixels from.channel
- Channel to create bins of (see static fields).
public static ImageIcon createHisto(Frame parent, ImageIcon img, int border, int height, Color color, int channel)
parent
- Parent window (for Message boxes).img
- Image to create histogram for.border
- Empty (unused) border around actual histogram.height
- Image height.color
- Color of histo lines.channel
- The channel to draw histogram for (CHANNEL_VALUE, CHANNEL_RED, CHANNEL_GREEN or CHANNEL_BLUE).
public void setImg1(ImageIcon img)
img
- Image to set as image 1.public void setImg2(ImageIcon img)
img
- Image to set as image 2.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |