Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ttools: add old-style frame zoom functionality to plot2 windows
The PtPlot-style zoom GUI where you drag out a band and on drag termination the plot is re-drawn to cover the given region is now added, it uses the middle mouse button (or shift) drag in plane, time and sky plots.
- Loading branch information
Showing
12 changed files
with
413 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
ttools/src/main/uk/ac/starlink/ttools/plot2/geom/BandDecoration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package uk.ac.starlink.ttools.plot2.geom; | ||
|
||
import java.awt.Point; | ||
import java.awt.Rectangle; | ||
import javax.swing.Icon; | ||
import uk.ac.starlink.ttools.plot2.Decoration; | ||
|
||
/** | ||
* Decoration subclass that also provides a target rectangle. | ||
* This target indicates a graphics surface region to which zooming | ||
* is intended. | ||
* | ||
* <p>Note that the target rectangle is not assessed as part of the | ||
* equality conditions for this object; it is considered to be | ||
* an annotation of the icon, completely determined by its existing | ||
* characteristics. | ||
* | ||
* @author Mark Taylor | ||
* @since 18 Mar 2014 | ||
*/ | ||
public class BandDecoration extends Decoration { | ||
|
||
private final Rectangle targetRect_; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param icon decoration content; this icon must have equality semantics | ||
* @param gx x position for icon | ||
* @param gy y position for icon | ||
* @param targetRect target rectangle | ||
*/ | ||
public BandDecoration( Icon icon, int gx, int gy, Rectangle targetRect ) { | ||
super( icon, gx, gy ); | ||
targetRect_ = targetRect; | ||
} | ||
|
||
/** | ||
* Returns the target rectangle for this object. | ||
* | ||
* @return target rectangle | ||
*/ | ||
public Rectangle getTargetRectangle() { | ||
return targetRect_; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.