|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
net.wasamon.mjlib.ui.CustomImage
public class CustomImage
画像を表示するための基本クラス
入れ子のクラスの概要 | |
---|---|
class |
CustomImage.ColorObj
色情報格納用の構造体(クラス) |
クラス javax.swing.JScrollPane から継承された入れ子のクラス/インタフェース |
---|
javax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar |
クラス javax.swing.JComponent から継承された入れ子のクラス/インタフェース |
---|
javax.swing.JComponent.AccessibleJComponent |
クラス java.awt.Container から継承された入れ子のクラス/インタフェース |
---|
java.awt.Container.AccessibleAWTContainer |
クラス java.awt.Component から継承された入れ子のクラス/インタフェース |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
フィールドの概要 | |
---|---|
private java.awt.BorderLayout |
borderLayout1
|
static int |
BOTTOM
|
private boolean |
center
|
static int |
CENTER
|
static int |
FREE_PLACE
img1にimg2を合成(サイズは同一であること) //cで透明にする色を、tpで合成の強さを指定 private Image mixImage(Image img1,Image img2,Color c,int tp){ if (img1 == null || img2 == null) return null; int p1,p2,red1,red2,green1,green2,blue1,blue2; int w = img1.getWidth(null); int h = img1.getHeight(null); int[] pix1 = new int[w*h]; PixelGrabber pg = new PixelGrabber(img1,0,0,w,h,pix1,0,w); try{ pg.grabPixels(); } catch(InterruptedException ex){ ; } int[] pix2 = new int[w*h]; pg = new PixelGrabber(img2,0,0,w,h,pix2,0,w); try{ pg.grabPixels(); } catch(InterruptedException ex){ ; } for (int i = 0;i < w*h;i++){ if (pix2[i] ! |
private javax.swing.ImageIcon |
icon
|
private java.awt.Image |
image
|
private javax.swing.JPanel |
jPanel1
|
private boolean |
jpeg_hq
|
static int |
LEFT
|
static int |
LEFT_BOTTOM
|
static int |
LEFT_TOP
|
private int |
maximage
|
static int |
REVERSE_LEFT_RIGHT
|
static int |
REVERSE_TOP_BOTTOM
|
static int |
RIGHT
|
static int |
RIGHT_BOTTOM
|
static int |
RIGHT_TOP
|
private java.awt.Dimension |
size
|
private boolean |
stretch
|
private boolean |
stretch_fast
|
private int |
sumcolors
|
static int |
TOP
|
static int |
TURN_LEFT_90DEGREE
|
static int |
TURN_RIGHT_90DEGREE
|
private java.util.Vector |
v
|
private javax.swing.JLabel |
viewLabel
|
クラス javax.swing.JScrollPane から継承されたフィールド |
---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
クラス javax.swing.JComponent から継承されたフィールド |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
クラス java.awt.Component から継承されたフィールド |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
インタフェース javax.swing.ScrollPaneConstants から継承されたフィールド |
---|
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT |
インタフェース java.awt.image.ImageObserver から継承されたフィールド |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
コンストラクタの概要 | |
---|---|
CustomImage()
コンストラクタ |
|
CustomImage(int max)
コンストラクタ2 |
メソッドの概要 | |
---|---|
private CustomImage.ColorObj |
binTree(CustomImage.ColorObj obj,
int c)
二分探索木による色情報格納 |
int |
countColors()
色数カウント |
private java.awt.Image |
doStretch(java.awt.Image image,
java.awt.Dimension dim)
アスペクト比を変えずに、画像を縮小 |
int |
getImageCount()
現在保持している画像の枚数をゲット |
int |
getImageHeight()
画像の縦ドット数をゲット |
int |
getImageWidth()
画像の横ドット数をゲット |
java.awt.Image |
getNowImage()
現在、保持しているイメージのゲット |
int[] |
getNowPixels()
現在のイメージを配列でゲット |
private int |
getRGBOne(int[] pix,
int x,
int y,
int w,
int h,
int rgb)
(x,y)地点の指定された色情報を返す |
boolean |
isCenter()
centerプロパティのゲット |
boolean |
isJpegHQ()
jpeg_hqプロパティのゲット |
boolean |
isStretch()
stretchプロパティのゲット |
boolean |
isStretchFast()
stretch_fastプロパティのゲット |
private void |
jbInit()
コンポーネントの初期化 |
private java.awt.Image |
mixImage2(java.awt.Image img1,
java.awt.Image img2,
java.awt.Color c,
int tp)
img1にimg2を合成(サイズは同一であること)<影付け専用メソッド> |
private void |
nowPaint()
画像表示メイン処理 |
void |
openFile(java.lang.String filename)
ファイルを開く |
void |
paintString(int def,
int xm,
int ym,
java.awt.Font f,
java.awt.Color c,
java.lang.String s,
int sh)
画像に文字列を描画 |
void |
reverseImage(int dir)
画像反転 |
void |
saveJpegFile(java.lang.String filename)
イメージをJPEG形式で保存 |
void |
setBeforeImage()
一つ前のイメージに戻す |
void |
setCenter(boolean ct)
centerプロパティのセット |
void |
setJpegHQ(boolean hq)
jpeg_hqプロパティのセット |
void |
setNewImage(java.awt.Image newimage)
新たなイメージのセット |
void |
setNewPixels(int[] pixels,
int w,
int h)
配列から新たなイメージをセット |
void |
setStretch(boolean st)
stretchプロパティのセット |
void |
setStretchFast(boolean sf)
stretch_fastプロパティのセット |
(package private) void |
this_componentResized(java.awt.event.ComponentEvent e)
縮小時、表示領域のサイズが変更された際、画像を表示しなおす |
void |
turnImage(int degree)
画像回転 |
クラス javax.swing.JScrollPane から継承されたメソッド |
---|
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI |
クラス javax.swing.JComponent から継承されたメソッド |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
クラス java.awt.Container から継承されたメソッド |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
クラス java.awt.Component から継承されたメソッド |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
フィールドの詳細 |
---|
private javax.swing.JPanel jPanel1
private java.awt.BorderLayout borderLayout1
private javax.swing.ImageIcon icon
private java.awt.Image image
private java.awt.Dimension size
private javax.swing.JLabel viewLabel
private boolean stretch
private boolean center
private boolean jpeg_hq
private boolean stretch_fast
private int sumcolors
private java.util.Vector v
private int maximage
public static final int FREE_PLACE
public static final int LEFT_TOP
public static final int TOP
public static final int RIGHT_TOP
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int LEFT_BOTTOM
public static final int BOTTOM
public static final int RIGHT_BOTTOM
public static final int TURN_RIGHT_90DEGREE
public static final int TURN_LEFT_90DEGREE
public static final int REVERSE_LEFT_RIGHT
public static final int REVERSE_TOP_BOTTOM
コンストラクタの詳細 |
---|
public CustomImage()
public CustomImage(int max)
メソッドの詳細 |
---|
private void jbInit() throws java.lang.Exception
java.lang.Exception
void this_componentResized(java.awt.event.ComponentEvent e)
public void setStretch(boolean st)
public boolean isStretch()
public void setCenter(boolean ct)
public boolean isCenter()
public void setJpegHQ(boolean hq)
public boolean isJpegHQ()
public void setStretchFast(boolean sf)
public boolean isStretchFast()
public void setNewImage(java.awt.Image newimage)
public java.awt.Image getNowImage()
public void setNewPixels(int[] pixels, int w, int h)
public int[] getNowPixels()
public void setBeforeImage()
public int getImageCount()
public int getImageWidth()
public int getImageHeight()
public void openFile(java.lang.String filename)
private void nowPaint()
private java.awt.Image doStretch(java.awt.Image image, java.awt.Dimension dim)
public void saveJpegFile(java.lang.String filename)
public int countColors()
private CustomImage.ColorObj binTree(CustomImage.ColorObj obj, int c)
public void paintString(int def, int xm, int ym, java.awt.Font f, java.awt.Color c, java.lang.String s, int sh)
private java.awt.Image mixImage2(java.awt.Image img1, java.awt.Image img2, java.awt.Color c, int tp)
private int getRGBOne(int[] pix, int x, int y, int w, int h, int rgb)
public void turnImage(int degree)
public void reverseImage(int dir)
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |