1// BEGIN LICENSE BLOCK
2// Version: CMPL 1.1
3//
4// The contents of this file are subject to the Cisco-style Mozilla Public
5// License Version 1.1 (the "License"); you may not use this file except
6// in compliance with the License.  You may obtain a copy of the License
7// at www.eclipse-clp.org/license.
8//
9// Software distributed under the License is distributed on an "AS IS"
10// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11// the License for the specific language governing rights and limitations
12// under the License.
13//
14// The Original Code is  The ECLiPSe Constraint Logic Programming System.
15// The Initial Developer of the Original Code is  Cisco Systems, Inc.
16// Portions created by the Initial Developer are
17// Copyright (C) 2006 Cisco Systems, Inc.  All Rights Reserved.
18//
19// Contributor(s):
20//
21// END LICENSE BLOCK
22
23package com.parctechnologies.eclipse.visualisation;
24
25import javax.swing.*;
26
27/**
28 * Provides a concrete base class for command issued on Viewer's.
29 *
30 * Typically resize and zoom actions
31 *
32 */
33public abstract class ViewerCommand extends SymRefCommand {
34
35    public ViewerCommand(SymRefable viewer) {
36	super(viewer);
37    }
38
39    /**
40     * Get the value of viewer.
41     * @return value of viewer.
42     */
43    public Viewer getViewer() {
44	return (Viewer)lookupSymRef();
45    }
46
47    protected JInternalFrame getInternalFrame()
48    {
49      return((JInternalFrame)
50          ((JComponent)getViewer().
51            getComponent()).getRootPane().getParent());
52
53    }
54
55    protected DesktopManager getDesktopManager()
56    {
57      	DesktopManager dm = getInternalFrame().getDesktopPane().getDesktopManager();
58        return(dm);
59    }
60
61    public abstract void postRecordIssue();
62}
63