114网址导航401 - Unauthorized: Access is denied due to invalid credentials.
401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.2.3. Dialogs and Docking
2.3. Dialogs and Docking
2.3.1. Organizing Dialogs
GIMP has great flexibility for arranging dialog on
your screen. A “dialog” is a moving window which
contains options for a tool or is dedicated to a special task. A
“dock” is a container which can hold a collection of
persistent dialogs, such as the Tool Options dialog, Brushes dialog,
Palette dialog, etc. Docks cannot, however, hold non-persistent dialogs
such as the Preferences dialog or an Image window.
GIMP has three default docks:
the Tool Options dock under the Toolbox in the left panel,
the Layers, Channels, Paths and Undo dock in the upper part of the
right panel,
the Brushes, Patterns and Gradients dock in the lower part of the
right panel.
In these docks, each dialog is in its own tab.
In multi-window mode, the Toolbox is a utility
window and not a dock. In single-window mode, it belongs to
the single window.
Windows → Dockable Dialogs
to view a list of dockable dialogs. Select a dockable dialog from
the list to view the dialog. If the dialog is available in a dock,
then it is made visible. If the dialog is not in a dock, the behavior
is different in multi and single window modes:
In multi-window mode, a new window, containing the dialog, appears
on the screen.
In single-window mode, the dialog is automatically docked to the
Layers-Undo dock as a tab.
You can click-and-drag a tab and drop it in the wanted place:
either in the tab bar of a dock, to integrate it in the dialog
or on a docking bar that appears as a blue line when the mouse
pointer goes over a dock border, to anchor the dialog to the dock.
In multi-window mode, you can also click on the dialog title and drag it
to the wanted place.
Figure 3.7. Integrating a new dialog in a dialog group
Here, in multi-window mode, the Histogram dialog was dragged to the
tab bar of the Layers-Undo dock.
More simple: the Add tab command in the Tab menu .
Figure 3.8. Anchoring a dialog to a dock border
The Histogram dialog dragged to the left vertical docking bar of
the right panel and the result: the dialog anchored to
the left border of the right panel. This dialog now belongs to the
right panel.
So, you can arrange dialogs in a multi-column
display, interesting if you work with two screens, one for dialogs,
the other for images.
Press TAB in an Image window to toggle the
visibility of the docks. This is useful if the docks hide a portion
of the image Window. You can quickly hide all the docks,
do your work, then display all the docs again.
Pressing TAB inside a dock to navigate
through the dock.
2.3.2. Tab Menu
Figure 3.9. A dialog in a dock, with the Tab menu button highlighted.
In each dialog, you can access a special menu of tab-related operations by
pressing the Tab Menu button, as highlighted in the figure above. Exactly
which commands are shown in the menu depends on the active dialog, but
they always include operations for creating new tabs, closing or
detaching tabs.
Figure 3.10. The Tab menu of the Layers dialog.
The Tab menu gives you access to the following commands:
Context Menu
At the top of each Tab menu, an entry opens the
dialog's context menu, which contains operations specific to that
particular type of dialog. For example, the context menu for the
Layers tab is Layers Menu, which contains
a set of operations for manipulating layers.
Add Tab opens into a submenu allowing you to
add a large variety of dockable dialogs as new tabs.
Figure 3.11. “Add tab” sub-menu
Close the dialog. Closing the last dialog in a dock
causes the dock itself to close.
Detach Tab
Detach the dialog from the dock, creating a new dock
with the detached dialog as its only member. It has the same
effect as dragging the tab out of the dock and releasing it at a
location where it cannot be docked.
It's a way to create a paradoxical new window in single-window mode!
If the tab is ,
this menu item is insensitive and grayed out.
Lock Tab to Dock
Prevent the dialog from being moved or detached. When activated,
Detach Tab is insensitive and grayed
Preview Size
Figure 3.12. Preview Size submenu of a Tab menu.
Many, but not all, dialogs have Tab menus containing a
Preview Size
option, which opens into a submenu giving a list of sizes for the
items in the dialog (see the figure above).
For example, the Brushes dialog shows pictures of all available
brushes: the Preview Size determines how large the pictures are.
The default is Medium.
Figure 3.13. Tab Style submenu of a Tab menu.
Available only when multiple dialogs are in the same dock,
Tab Style opens a submenu allowing you
to choose the appearance of the tabs at the top (see the figure
above). There are five choices, not all are available for every
Use an icon to represent the dialog type.
Current Status
Is only available for dialogs that allows you
to select something, such as a brush, pattern,
gradient, etc. Current Status
shows a representation of the currently selected
item in the tab top.
Use text to display the dialog type.
Icon and Text
Using both an icon and text results in wider tabs.
Status and Text
Show the currently selected item and text with the dialog
View as L View as Grid
These entries are shown in dialogs that allow you to select an
item from a set: brushes, patterns, fonts, etc. You can choose
to view the items as a vertical list, with the name of
each beside it, or as a grid, with representations of the items
but no names. Each has its advantages: viewing as a list gives you
more information, but viewing as a grid allows you to see
more possibilities at once. The default for this varies across
dialogs: for brushes and patterns, t for most
other things, the default is a list.
When the tree-view is View as List, you can
use tags. Please see .
You can also use a list search field:
Figure 3.14. The list search field.
to open the list search field. An item must be selected for
this command to be effective.
The list search field automatically closes after five seconds
if you do nothing.
The search field shortcut is also available for the tree-view you
get in the “Brush”, “Font” or
“Pattern” option of several tools.
Show Button Bar
Some dialogs display a button bar on the
example, the Patterns, Brushes, Gradients, and Images dialogs.
This is a toggle. If it is checked, then the Button Bar is
displayed.
Figure 3.15. Button Bar on the Brushes dialog.
Show Image Selection
This option is available in multi-window mode only.
This is a toggle. If it is checked, then an Image Menu is shown at
the top of the dock:
Figure 3.16. A dock with an Image Menu highlighted.
It is not available for dialogs docked below the Toolbox. This
option is interesting only if you have several open images on your
Auto Follow Active Image
This option is available in multi-window mode only.
This option is also interesting only if you have several images
open on your screen. Then, the information displayed in a dock
is always that of the selected image in the Image Selection
drop-down list. If the Auto Follow Active Image
is disabled, the image can be selected only in the
Image Selection. If enabled, you
can also select it by
activating the image directly (clicking on its title bar).ImageView (JavaFX 2.2)
JavaScript is disabled on your browser.
Class ImageView
java.lang.Object
javafx.scene.image.ImageView
All Implemented Interfaces:
(="image")
public class ImageView
The ImageView is a Node used for painting images loaded with
This class allows resizing the displayed image (with or without preserving
the original aspect ratio) and specifying a viewport into the source image
for restricting the pixels displayed by this ImageView.
Example code for displaying images
import javafx.application.A
import javafx.geometry.Rectangle2D;
import javafx.scene.G
import javafx.scene.S
import javafx.scene.image.I
import javafx.scene.image.ImageV
import javafx.scene.layout.HB
import javafx.scene.paint.C
import javafx.stage.S
public class HelloMenu extends Application {
@Override public void start(Stage stage) {
// load the image
Image image = new Image("flower.png");
// simple displays ImageView the image as is
ImageView iv1 = new ImageView();
iv1.setImage(image);
// resizes the image to have width of 100 while preserving the ratio and using
// higher qual this ImageView is also cached to
// improve performance
ImageView iv2 = new ImageView();
iv2.setImage(image);
iv2.setFitWidth(100);
iv2.setPreserveRatio(true);
iv2.setSmooth(true);
iv2.setCache(true);
// defines a viewport into the source image (achieving a "zoom" effect) and
// displays it rotated
ImageView iv3 = new ImageView();
iv3.setImage(image);
Rectangle2D viewportRect = new Rectangle2D(40, 35, 110, 110);
iv3.setViewport(viewportRect);
iv3.setRotate(90);
Group root = new Group();
Scene scene = new Scene(root);
scene.setFill(Color.BLACK);
HBox box = new HBox();
box.getChildren().add(iv1);
box.getChildren().add(iv2);
box.getChildren().add(iv3);
root.getChildren().add(box);
stage.setTitle("ImageView");
stage.setWidth(415);
stage.setHeight(200);
stage.setScene(scene);
stage.sizeToScene();
stage.show();
public static void main(String[] args) {
Application.launch(args);
The code above produces the following:
Property Summary
Properties&
Property and Description
The height of the bounding box within which the source image is resized
as necessary to fit.
The width of the bounding box within which the source image is resized as
necessary to fit.
to be painted by this ImageView.
Indicates whether to preserve the aspect ratio of the source image when
scaling to fit the image within the fitting bounding box.
Indicates whether to use a better quality filtering algorithm or a faster
one when transforming or scaling the source image to fit within the
bounding box provided by fitWidth and fitHeight.
The rectangular viewport into the image.
The current x coordinate of the ImageView origin.
The current y coordinate of the ImageView origin.
Properties inherited from class&javafx.scene.
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Field Summary
Modifier and Type
Field and Description
static boolean
Platform-dependent default value of the
Constructor Summary
Constructors&
Constructor and Description
Allocates a new ImageView object.
Allocates a new ImageView object using the given image.
(java.lang.String&url)
Allocates a new ImageView object with image loaded from the specified
Method Summary
Modifier and Type
Method and Description
The height of the bounding box within which the source image is resized
as necessary to fit.
The width of the bounding box within which the source image is resized as
necessary to fit.
Gets the value of the property fitHeight.
Gets the value of the property fitWidth.
Gets the value of the property image.
Gets the value of the property viewport.
Gets the value of the property x.
Gets the value of the property y.
to be painted by this ImageView.
Gets the value of the property preserveRatio.
Gets the value of the property smooth.
Indicates whether to preserve the aspect ratio of the source image when
scaling to fit the image within the fitting bounding box.
(double&value)
Sets the value of the property fitHeight.
(double&value)
Sets the value of the property fitWidth.
Sets the value of the property image.
(boolean&value)
Sets the value of the property preserveRatio.
(boolean&value)
Sets the value of the property smooth.
Sets the value of the property viewport.
(double&value)
Sets the value of the property x.
(double&value)
Sets the value of the property y.
Indicates whether to use a better quality filtering algorithm or a faster
one when transforming or scaling the source image to fit within the
bounding box provided by fitWidth and fitHeight.
The rectangular viewport into the image.
The current x coordinate of the ImageView origin.
The current y coordinate of the ImageView origin.
Methods inherited from class&javafx.scene.
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Methods inherited from class&java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Property Detail
public final&&& imageProperty
to be painted by this ImageView.
Default value:
See Also:,
public final& xProperty
The current x coordinate of the ImageView origin.
Default value:
See Also:,
public final& yProperty
The current y coordinate of the ImageView origin.
Default value:
See Also:,
public final& fitWidthProperty
The width of the bounding box within which the source image is resized as
necessary to fit. If set to a value <= 0, then the intrinsic width of the
image will be used as the fitWidth.
for information on interaction between image
view's fitWidth, fitHeight and preserveRatio
attributes.
Default value:
See Also:,
public final& fitHeightProperty
The height of the bounding box within which the source image is resized
as necessary to fit. If set to a value <= 0, then the intrinsic height of
the image will be used as the fitHeight.
for information on interaction between image
view's fitWidth, fitHeight and preserveRatio
attributes.
Default value:
See Also:,
preserveRatio
public final& preserveRatioProperty
Indicates whether to preserve the aspect ratio of the source image when
scaling to fit the image within the fitting bounding box.
If set to true, it affects the dimensions of this
ImageView in the following way *
If only fitWidth is set, height is scaled to preserve ratio
If only fitHeight is set, width is scaled to preserve ratio
If both are set, they both may be scaled to get the best fit in a
width by height rectangle while preserving the original aspect ratio
If unset or set to false, it affects the dimensions of this
ImageView in the following way *
If only fitWidth is set, image's view width is scaled to
If only fitHeight is set, image's view height is scaled to
If both are set, the image view is scaled to match both.
Note that the dimensions of this node as reported by the node's bounds
will be equal to the size of the scaled image and is guaranteed to be
contained within fitWidth x fitHeight bonding box.
Default value:
See Also:,
public final& smoothProperty
Indicates whether to use a better quality filtering algorithm or a faster
one when transforming or scaling the source image to fit within the
bounding box provided by fitWidth and fitHeight.
If set to true a better quality filtering will be used, if set to
false a faster but lesser quality filtering will be used.
The default value depends on platform configuration.
Default value:
platform-dependent
See Also:,
public final&&& viewportProperty
The rectangular viewport into the image. The viewport is specified in the
coordinates of the image, prior to scaling or any other transformations.
If viewport is null, the entire image is displayed. If
viewport is non-null, only the portion of the image which
falls within the viewport will be displayed. If the image does not fully
cover the viewport then any remaining area of the viewport will be empty.
Default value:
See Also:,
Field Detail
SMOOTH_DEFAULT
public static final&boolean SMOOTH_DEFAULT
Platform-dependent default value of the
Constructor Detail
public&ImageView()
Allocates a new ImageView object.
public&ImageView(java.lang.String&url)
Allocates a new ImageView object with image loaded from the specified
The new ImageView(url) has the same effect as
new ImageView(new Image(url)).
Parameters:url - the string representing the URL from which to load the image
java.lang.NullPointerException - if URL is null
java.lang.IllegalArgumentException - if URL is invalid or unsupportedSince:
JavaFX 2.1
public&ImageView(&image)
Allocates a new ImageView object using the given image.
Parameters:image - Image that this ImageView uses
Method Detail
public final&void&setImage(&value)
Sets the value of the property image.
Property description:
to be painted by this ImageView.
Default value:
public final&&getImage()
Gets the value of the property image.
Property description:
to be painted by this ImageView.
Default value:
imageProperty
public final&&&&imageProperty()
to be painted by this ImageView.
Default value:
See Also:,
public final&void&setX(double&value)
Sets the value of the property x.
Property description:
The current x coordinate of the ImageView origin.
Default value:
public final&double&getX()
Gets the value of the property x.
Property description:
The current x coordinate of the ImageView origin.
Default value:
public final&&xProperty()
The current x coordinate of the ImageView origin.
Default value:
See Also:,
public final&void&setY(double&value)
Sets the value of the property y.
Property description:
The current y coordinate of the ImageView origin.
Default value:
public final&double&getY()
Gets the value of the property y.
Property description:
The current y coordinate of the ImageView origin.
Default value:
public final&&yProperty()
The current y coordinate of the ImageView origin.
Default value:
See Also:,
setFitWidth
public final&void&setFitWidth(double&value)
Sets the value of the property fitWidth.
Property description:
The width of the bounding box within which the source image is resized as
necessary to fit. If set to a value <= 0, then the intrinsic width of the
image will be used as the fitWidth.
for information on interaction between image
view's fitWidth, fitHeight and preserveRatio
attributes.
Default value:
getFitWidth
public final&double&getFitWidth()
Gets the value of the property fitWidth.
Property description:
The width of the bounding box within which the source image is resized as
necessary to fit. If set to a value <= 0, then the intrinsic width of the
image will be used as the fitWidth.
for information on interaction between image
view's fitWidth, fitHeight and preserveRatio
attributes.
Default value:
fitWidthProperty
public final&&fitWidthProperty()
The width of the bounding box within which the source image is resized as
necessary to fit. If set to a value <= 0, then the intrinsic width of the
image will be used as the fitWidth.
for information on interaction between image
view's fitWidth, fitHeight and preserveRatio
attributes.
Default value:
See Also:,
setFitHeight
public final&void&setFitHeight(double&value)
Sets the value of the property fitHeight.
Property description:
The height of the bounding box within which the source image is resized
as necessary to fit. If set to a value <= 0, then the intrinsic height of
the image will be used as the fitHeight.
for information on interaction between image
view's fitWidth, fitHeight and preserveRatio
attributes.
Default value:
getFitHeight
public final&double&getFitHeight()
Gets the value of the property fitHeight.
Property description:
The height of the bounding box within which the source image is resized
as necessary to fit. If set to a value <= 0, then the intrinsic height of
the image will be used as the fitHeight.
for information on interaction between image
view's fitWidth, fitHeight and preserveRatio
attributes.
Default value:
fitHeightProperty
public final&&fitHeightProperty()
The height of the bounding box within which the source image is resized
as necessary to fit. If set to a value <= 0, then the intrinsic height of
the image will be used as the fitHeight.
for information on interaction between image
view's fitWidth, fitHeight and preserveRatio
attributes.
Default value:
See Also:,
setPreserveRatio
public final&void&setPreserveRatio(boolean&value)
Sets the value of the property preserveRatio.
Property description:
Indicates whether to preserve the aspect ratio of the source image when
scaling to fit the image within the fitting bounding box.
If set to true, it affects the dimensions of this
ImageView in the following way *
If only fitWidth is set, height is scaled to preserve ratio
If only fitHeight is set, width is scaled to preserve ratio
If both are set, they both may be scaled to get the best fit in a
width by height rectangle while preserving the original aspect ratio
If unset or set to false, it affects the dimensions of this
ImageView in the following way *
If only fitWidth is set, image's view width is scaled to
If only fitHeight is set, image's view height is scaled to
If both are set, the image view is scaled to match both.
Note that the dimensions of this node as reported by the node's bounds
will be equal to the size of the scaled image and is guaranteed to be
contained within fitWidth x fitHeight bonding box.
Default value:
isPreserveRatio
public final&boolean&isPreserveRatio()
Gets the value of the property preserveRatio.
Property description:
Indicates whether to preserve the aspect ratio of the source image when
scaling to fit the image within the fitting bounding box.
If set to true, it affects the dimensions of this
ImageView in the following way *
If only fitWidth is set, height is scaled to preserve ratio
If only fitHeight is set, width is scaled to preserve ratio
If both are set, they both may be scaled to get the best fit in a
width by height rectangle while preserving the original aspect ratio
If unset or set to false, it affects the dimensions of this
ImageView in the following way *
If only fitWidth is set, image's view width is scaled to
If only fitHeight is set, image's view height is scaled to
If both are set, the image view is scaled to match both.
Note that the dimensions of this node as reported by the node's bounds
will be equal to the size of the scaled image and is guaranteed to be
contained within fitWidth x fitHeight bonding box.
Default value:
preserveRatioProperty
public final&&preserveRatioProperty()
Indicates whether to preserve the aspect ratio of the source image when
scaling to fit the image within the fitting bounding box.
If set to true, it affects the dimensions of this
ImageView in the following way *
If only fitWidth is set, height is scaled to preserve ratio
If only fitHeight is set, width is scaled to preserve ratio
If both are set, they both may be scaled to get the best fit in a
width by height rectangle while preserving the original aspect ratio
If unset or set to false, it affects the dimensions of this
ImageView in the following way *
If only fitWidth is set, image's view width is scaled to
If only fitHeight is set, image's view height is scaled to
If both are set, the image view is scaled to match both.
Note that the dimensions of this node as reported by the node's bounds
will be equal to the size of the scaled image and is guaranteed to be
contained within fitWidth x fitHeight bonding box.
Default value:
See Also:,
public final&void&setSmooth(boolean&value)
Sets the value of the property smooth.
Property description:
Indicates whether to use a better quality filtering algorithm or a faster
one when transforming or scaling the source image to fit within the
bounding box provided by fitWidth and fitHeight.
If set to true a better quality filtering will be used, if set to
false a faster but lesser quality filtering will be used.
The default value depends on platform configuration.
Default value:
platform-dependent
public final&boolean&isSmooth()
Gets the value of the property smooth.
Property description:
Indicates whether to use a better quality filtering algorithm or a faster
one when transforming or scaling the source image to fit within the
bounding box provided by fitWidth and fitHeight.
If set to true a better quality filtering will be used, if set to
false a faster but lesser quality filtering will be used.
The default value depends on platform configuration.
Default value:
platform-dependent
smoothProperty
public final&&smoothProperty()
Indicates whether to use a better quality filtering algorithm or a faster
one when transforming or scaling the source image to fit within the
bounding box provided by fitWidth and fitHeight.
If set to true a better quality filtering will be used, if set to
false a faster but lesser quality filtering will be used.
The default value depends on platform configuration.
Default value:
platform-dependent
See Also:,
setViewport
public final&void&setViewport(&value)
Sets the value of the property viewport.
Property description:
The rectangular viewport into the image. The viewport is specified in the
coordinates of the image, prior to scaling or any other transformations.
If viewport is null, the entire image is displayed. If
viewport is non-null, only the portion of the image which
falls within the viewport will be displayed. If the image does not fully
cover the viewport then any remaining area of the viewport will be empty.
Default value:
getViewport
public final&&getViewport()
Gets the value of the property viewport.
Property description:
The rectangular viewport into the image. The viewport is specified in the
coordinates of the image, prior to scaling or any other transformations.
If viewport is null, the entire image is displayed. If
viewport is non-null, only the portion of the image which
falls within the viewport will be displayed. If the image does not fully
cover the viewport then any remaining area of the viewport will be empty.
Default value:
viewportProperty
public final&&&&viewportProperty()
The rectangular viewport into the image. The viewport is specified in the
coordinates of the image, prior to scaling or any other transformations.
If viewport is null, the entire image is displayed. If
viewport is non-null, only the portion of the image which
falls within the viewport will be displayed. If the image does not fully
cover the viewport then any remaining area of the viewport will be empty.
Default value:
See Also:,
(c) , Oracle and/or its affiliates. All rights reserved.