Skip to content

Commit

Permalink
AsterWorkspace implements interface of CmdConnection
Browse files Browse the repository at this point in the history
It is the target which draw snapshot from CmdConnection to user
  • Loading branch information
walkingice committed Dec 12, 2012
1 parent 8d69748 commit e71402d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/org/zeroxlab/aster/AsterWorkspace.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,20 @@
import javax.swing.event.ChangeListener;

import org.zeroxlab.aster.ActionListModel;
import org.zeroxlab.aster.CmdConnection.SnapshotDrawer;
import org.zeroxlab.aster.cmds.AsterCommand;
import org.zeroxlab.aster.cmds.AsterCommand.CommandListener;
import org.zeroxlab.aster.operations.AsterOperation;
import org.zeroxlab.aster.operations.AsterOperation.OperationListener;
import org.zeroxlab.aster.operations.OpDrag;
import org.zeroxlab.aster.operations.OpTouch;

public class AsterWorkspace extends JPanel implements ComponentListener
, MouseListener
, MouseMotionListener
, ChangeListener
, AsterOperation.OperationListener {
public class AsterWorkspace extends JPanel implements ComponentListener,
MouseListener,
MouseMotionListener,
ChangeListener,
CmdConnection.SnapshotDrawer,
AsterOperation.OperationListener {

public final static int LANDSCAPE_WIDTH = 400;
public final static int LANDSCAPE_HEIGHT = 240;
Expand Down Expand Up @@ -242,12 +244,14 @@ public ImageIcon createScaledIcon(String resourceName, int width, int height) {
return icon;
}

@Override
public void setImage(BufferedImage img) {
mSourceImage = img;
if (mSourceImage != null) {
generateDrawingBuffer();
updateDrawingBuffer(mSourceImage);
}
repaint();
}

public void fillCmd(AsterCommand cmd, FillListener listener) {
Expand Down

0 comments on commit e71402d

Please sign in to comment.