All Packages Class Hierarchy This Package Previous Next Index
Class Pixmap.Pixmap
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----Pixmap.Pixmap
- public class Pixmap
- extends Canvas
- implements ActionListener
Class for manipulating graphics images
originally developed in C++
revision history for C++ version
Modified: 3/21/94
11/29/94
4/13/95
Ported: 10/16/1996 to Java (Syam Gadde)
re-implemented, ported to 1.1 6/1/97 (Owen Astrachan)
this class represents an image that supports
manipulation, i.e., reflection, expansion, inversion, etc.
It has an analog in C++ for comparison between the two languages
although there is more support in Java for images than there is
in C++.
Creating a pixmap requires a filename that should be a gif or jpg
image (or others if getImage() supports them). Currently the
filename represents a local image, but changing the URL to support
network retrievable images should be straightforward
- Author:
- Owen Astrachan, Syam Gadde
-
Pixmap(Frame, PixController, String)
- create a pixmap (by reading a local file), the pixmap is added
to a PixApp, and displayed in a frame
-
actionPerformed(ActionEvent)
- redisplays this pixmap as the active pixmap
-
expand(int, int)
-
-
getIcon()
-
-
getPreferredSize()
- overrides Component.getPreferredSize()
-
horizReflect()
- reflect this horizontally (which means through a
vertical line drawn through the middle of the
Pixmap) ---> | <---
-
invert()
- turn all pixels to there 'opposite color'.
-
paint(Graphics)
- overrides Component.paint()
-
vertReflect()
-
Pixmap
public Pixmap(Frame parent,
PixController control,
String filename)
- create a pixmap (by reading a local file), the pixmap is added
to a PixApp, and displayed in a frame
- Parameters:
- parent - the frame in which the pixmap is displayed
- app - the Application to which this pixmap will be added
- filename - complete pathname of the local file that can
be read by getImage()
actionPerformed
public void actionPerformed(ActionEvent ev)
- redisplays this pixmap as the active pixmap
- Parameters:
- ev - the action event causing the redisplay
getIcon
public PixIcon getIcon()
- Returns:
- the PixIcon associated with this Pixmap
getPreferredSize
public Dimension getPreferredSize()
- overrides Component.getPreferredSize()
- Overrides:
- getPreferredSize in class Component
paint
public void paint(Graphics g)
- overrides Component.paint()
- Overrides:
- paint in class Canvas
vertReflect
public void vertReflect()
horizReflect
public void horizReflect()
- reflect this horizontally (which means through a
vertical line drawn through the middle of the
Pixmap) ---> | <---
expand
public void expand(int rowExpand,
int colExpand)
invert
public void invert()
- turn all pixels to there 'opposite color'. Black to white,
white to black, and invert RGB pixel by taking negative
relative to 255 (max RGB value), i.e., red = 255 - red, and
similarly for blue and green pixel values
All Packages Class Hierarchy This Package Previous Next Index