sub_arctic.test
Class image_cutter

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--sub_arctic.lib.interactor_applet
                                |
                                +--sub_arctic.lib.debug_interactor_applet
                                      |
                                      +--sub_arctic.test.image_cutter

public class image_cutter
extends debug_interactor_applet
implements callback_object, interactor_consts

This is a small demo program that allows rectangular sections to be cut out of images (loaded from a URL) and then written out as subArctic code for statically initializing a loaded_image object.

See Also:
Serialized Form

Field Summary
protected static int border
          Border around image
protected  interactor cut_x1
          Cutter interactor for x1
protected  interactor cut_x2
          Cutter interactor for x2
protected  interactor cut_y1
          Cutter interactor for y1
protected  interactor cut_y2
          Cutter interactor for y2
protected static int cutter_inset
          Cutter inset from border
protected static java.lang.String default_save
          Default save name
protected static java.lang.String default_url
          Default URL for the image
protected  button load_button
          Button for loading
protected  oneline_text_edit load_name
          Text edit area for URL to load from
protected  label message
          Label for error message
protected  button save_button
          Button for saving
protected  oneline_text_edit save_name
          Text edit area for file to save to
protected static java.awt.Font tag_font
          Font for coord display tags
protected  icon the_image
          Icon object holding the image we are dealing with
 
Fields inherited from class sub_arctic.lib.debug_interactor_applet
_fake_top
 
Fields inherited from class sub_arctic.lib.interactor_applet
_top_interactor, last_evt_was_move, last_move_evt_x, last_move_evt_y
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Method Summary
protected  interactor build_horiz_cutter(boolean near_line)
          Build a horizontal cutter line and tag inside a drag container
protected  interactor build_size_display()
          Build objects for a size display
 void build_ui(base_parent_interactor top)
          Initialization of sub_arctic interface when applet starts
protected  interactor build_vert_cutter(boolean near_line)
          Build a vertical cutter line and tag inside a drag container
 void callback(interactor from, event evt, int cb_num, java.lang.Object cb_parm)
          Handle callbacks.
protected  void fix_cut_bounds(interactor from)
          Make sure cutters in in bounds and in order
protected  void load_image(java.lang.String name)
          Load image from given location (a URL)
protected  void save_image(java.lang.String name)
          Write image (as subArctic static init code) into file with given name
 
Methods inherited from class sub_arctic.lib.debug_interactor_applet
do_init, make_top_level
 
Methods inherited from class sub_arctic.lib.interactor_applet
destroy, init, isFocusTraversable, paint, post_build_ui, pre_build_ui, processEvent, remove_top_interactor, set_top_interactor, setBounds, top_interactor, update
 
Methods inherited from class java.applet.Applet
getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

border

protected static final int border
Border around image

cutter_inset

protected static final int cutter_inset
Cutter inset from border

tag_font

protected static java.awt.Font tag_font
Font for coord display tags

default_url

protected static final java.lang.String default_url
Default URL for the image

default_save

protected static final java.lang.String default_save
Default save name

the_image

protected icon the_image
Icon object holding the image we are dealing with

cut_x1

protected interactor cut_x1
Cutter interactor for x1

cut_y1

protected interactor cut_y1
Cutter interactor for y1

cut_x2

protected interactor cut_x2
Cutter interactor for x2

cut_y2

protected interactor cut_y2
Cutter interactor for y2

load_name

protected oneline_text_edit load_name
Text edit area for URL to load from

save_name

protected oneline_text_edit save_name
Text edit area for file to save to

load_button

protected button load_button
Button for loading

save_button

protected button save_button
Button for saving

message

protected label message
Label for error message
Method Detail

build_ui

public void build_ui(base_parent_interactor top)
Initialization of sub_arctic interface when applet starts
Parameters:
base_parent_interactor - top the root interactor we build under
Overrides:
build_ui in class interactor_applet

build_horiz_cutter

protected interactor build_horiz_cutter(boolean near_line)
Build a horizontal cutter line and tag inside a drag container
Parameters:
boolean - near_line indication of near or far line.

build_vert_cutter

protected interactor build_vert_cutter(boolean near_line)
Build a vertical cutter line and tag inside a drag container
Parameters:
boolean - near_line indication of near or far line.

build_size_display

protected interactor build_size_display()
Build objects for a size display

callback

public void callback(interactor from,
                     event evt,
                     int cb_num,
                     java.lang.Object cb_parm)
Handle callbacks.
Specified by:
callback in interface callback_object

fix_cut_bounds

protected void fix_cut_bounds(interactor from)
Make sure cutters in in bounds and in order

load_image

protected void load_image(java.lang.String name)
Load image from given location (a URL)

save_image

protected void save_image(java.lang.String name)
Write image (as subArctic static init code) into file with given name