下面列出了怎么用java.beans.ConstructorProperties的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Create a new scrollpane container.
* @param scrollbarDisplayPolicy policy for when scrollbars should be shown
* @throws IllegalArgumentException if the specified scrollbar
* display policy is invalid
* @throws HeadlessException if GraphicsEnvironment.isHeadless()
* returns true
* @see java.awt.GraphicsEnvironment#isHeadless
*/
@ConstructorProperties({"scrollbarDisplayPolicy"})
public ScrollPane(int scrollbarDisplayPolicy) throws HeadlessException {
GraphicsEnvironment.checkHeadless();
this.layoutMgr = null;
this.width = 100;
this.height = 100;
switch (scrollbarDisplayPolicy) {
case SCROLLBARS_NEVER:
case SCROLLBARS_AS_NEEDED:
case SCROLLBARS_ALWAYS:
this.scrollbarDisplayPolicy = scrollbarDisplayPolicy;
break;
default:
throw new IllegalArgumentException("illegal scrollbar display policy");
}
vAdjustable = new ScrollPaneAdjustable(this, new PeerFixer(this),
Adjustable.VERTICAL);
hAdjustable = new ScrollPaneAdjustable(this, new PeerFixer(this),
Adjustable.HORIZONTAL);
setWheelScrollingEnabled(defaultWheelScroll);
}
/**
* Creates a TitledBorder instance with the specified border,
* title, title-justification, title-position, title-font, and
* title-color.
*
* @param border the border
* @param title the title the border should display
* @param titleJustification the justification for the title
* @param titlePosition the position for the title
* @param titleFont the font of the title
* @param titleColor the color of the title
*/
@ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
public TitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor) {
this.title = title;
this.border = border;
this.titleFont = titleFont;
this.titleColor = titleColor;
setTitleJustification(titleJustification);
setTitlePosition(titlePosition);
this.label = new JLabel();
this.label.setOpaque(false);
this.label.putClientProperty(BasicHTML.propertyKey, null);
}
/**
* Constructs a <code>DefaultCellEditor</code> that uses a text field.
*
* @param textField a <code>JTextField</code> object
*/
@ConstructorProperties({"component"})
public DefaultCellEditor(final JTextField textField) {
editorComponent = textField;
this.clickCountToStart = 2;
delegate = new EditorDelegate() {
public void setValue(Object value) {
textField.setText((value != null) ? value.toString() : "");
}
public Object getCellEditorValue() {
return textField.getText();
}
};
textField.addActionListener(delegate);
}
/**
* Constructs a <code>DefaultCellEditor</code> that uses a text field.
*
* @param textField a <code>JTextField</code> object
*/
@ConstructorProperties({"component"})
public DefaultCellEditor(final JTextField textField) {
editorComponent = textField;
this.clickCountToStart = 2;
delegate = new EditorDelegate() {
public void setValue(Object value) {
textField.setText((value != null) ? value.toString() : "");
}
public Object getCellEditorValue() {
return textField.getText();
}
};
textField.addActionListener(delegate);
}
/**
* Constructs a <code>DefaultCellEditor</code> that uses a text field.
*
* @param textField a <code>JTextField</code> object
*/
@ConstructorProperties({"component"})
public DefaultCellEditor(final JTextField textField) {
editorComponent = textField;
this.clickCountToStart = 2;
delegate = new EditorDelegate() {
public void setValue(Object value) {
textField.setText((value != null) ? value.toString() : "");
}
public Object getCellEditorValue() {
return textField.getText();
}
};
textField.addActionListener(delegate);
}
@ConstructorProperties( { "redundantCopies", "totalMaxMemory",
"totalNumBuckets", "localMaxMemory", "colocatedWith",
"partitionResolver", "recoveryDelay", "startupRecoveryDelay",
"partitionListeners" })
public PartitionAttributesData(int redundantCopies, long totalMaxMemory,
int totalNumBuckets, int localMaxMemory, String colocatedWith,
String partitionResolver, long recoveryDelay, long startupRecoveryDelay,
String[] partitionListeners) {
this.redundantCopies = redundantCopies;
this.totalMaxMemory = totalMaxMemory;
this.totalNumBuckets = totalNumBuckets;
this.localMaxMemory = localMaxMemory;
this.colocatedWith = colocatedWith;
this.partitionResolver = partitionResolver;
this.recoveryDelay = recoveryDelay;
this.startupRecoveryDelay = startupRecoveryDelay;
this.partitionListeners = partitionListeners;
}
/**
* Create a new scrollpane container.
* @param scrollbarDisplayPolicy policy for when scrollbars should be shown
* @throws IllegalArgumentException if the specified scrollbar
* display policy is invalid
* @throws HeadlessException if GraphicsEnvironment.isHeadless()
* returns true
* @see java.awt.GraphicsEnvironment#isHeadless
*/
@ConstructorProperties({"scrollbarDisplayPolicy"})
public ScrollPane(int scrollbarDisplayPolicy) throws HeadlessException {
GraphicsEnvironment.checkHeadless();
this.layoutMgr = null;
this.width = 100;
this.height = 100;
switch (scrollbarDisplayPolicy) {
case SCROLLBARS_NEVER:
case SCROLLBARS_AS_NEEDED:
case SCROLLBARS_ALWAYS:
this.scrollbarDisplayPolicy = scrollbarDisplayPolicy;
break;
default:
throw new IllegalArgumentException("illegal scrollbar display policy");
}
vAdjustable = new ScrollPaneAdjustable(this, new PeerFixer(this),
Adjustable.VERTICAL);
hAdjustable = new ScrollPaneAdjustable(this, new PeerFixer(this),
Adjustable.HORIZONTAL);
setWheelScrollingEnabled(defaultWheelScroll);
}
@ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
public TitledBorderUIResource(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor) {
super(border, title, titleJustification, titlePosition, titleFont, titleColor);
}
@ConstructorProperties( { "name", "primary", "numBucket"
})
public FixedPartitionAttributesData(String name, boolean primary,
int numBucket) {
this.name = name;
this.primary = primary;
this.numBucket = numBucket;
}
/**
* Creates an empty border with the specified insets.
* @param borderInsets the insets of the border
*/
@ConstructorProperties({"borderInsets"})
public EmptyBorder(Insets borderInsets) {
this.top = borderInsets.top;
this.right = borderInsets.right;
this.bottom = borderInsets.bottom;
this.left = borderInsets.left;
}
@JsonCreator
@ConstructorProperties({"id", "player1", "player2", "data"})
public Marriage(@JsonProperty("id") String id, @JsonProperty("player1") String player1, @JsonProperty("player2") String player2, MarriageData data) {
this.id = id;
this.player1 = player1;
this.player2 = player2;
this.data = data;
}
@ConstructorProperties({"blackListedGuilds", "blackListedUsers", "patreonUsers", "tempbans", "mutes"})
@JsonCreator
public MantaroObj(@JsonProperty("blackListedGuilds") List<String> blackListedGuilds,
@JsonProperty("blackListedUsers") List<String> blackListedUsers,
@JsonProperty("patreonUsers") List<String> patreonUsers,
@JsonProperty("tempBans") Map<String, Long> tempBans,
@JsonProperty("mutes") Map<Long, Pair<String, Long>> mutes) {
this.blackListedGuilds = blackListedGuilds;
this.blackListedUsers = blackListedUsers;
this.patreonUsers = patreonUsers;
this.tempBans = tempBans;
this.mutes = mutes;
}
/**
* Creates an empty border with the specified insets.
* @param borderInsets the insets of the border
*/
@ConstructorProperties({"borderInsets"})
public EmptyBorder(Insets borderInsets) {
this.top = borderInsets.top;
this.right = borderInsets.right;
this.bottom = borderInsets.bottom;
this.left = borderInsets.left;
}
/**
* Creates a new cursor object with the specified type.
* @param type the type of cursor
* @throws IllegalArgumentException if the specified cursor type
* is invalid
*/
@ConstructorProperties({"type"})
public Cursor(int type) {
if (type < Cursor.DEFAULT_CURSOR || type > Cursor.MOVE_CURSOR) {
throw new IllegalArgumentException("illegal cursor type");
}
this.type = type;
// Lookup localized name.
name = Toolkit.getProperty(cursorProperties[type][0],
cursorProperties[type][1]);
}
@ConstructorProperties({"states","lastModTS","creationTS","processorPoolId","workflowClassname","max","offset"})
public WorkflowInstanceFilter(List<String> states, HalfOpenTimeInterval lastModTS, HalfOpenTimeInterval creationTS, String processorPoolId, String workflowClassname, int max, int offset) {
this.states = states;
this.lastModTS = lastModTS;
this.creationTS = creationTS;
this.processorPoolId = processorPoolId;
this.workflowClassname = workflowClassname;
this.max = max;
this.offset = offset;
}
@JsonCreator
@ConstructorProperties({"id", "duration", "expiration", "type", "enabled", "owner"})
public PremiumKey(@JsonProperty("id") String id, @JsonProperty("duration") long duration,
@JsonProperty("expiration") long expiration, @JsonProperty("type") Type type,
@JsonProperty("enabled") boolean enabled, @JsonProperty("owner") String owner, @JsonProperty("data") PremiumKeyData data) {
this.id = id;
this.duration = duration;
this.expiration = expiration;
this.type = type.ordinal();
this.enabled = enabled;
this.owner = owner;
if (data != null)
this.data = data;
}
@ConstructorProperties( { "connectionLoad", "subscriberLoad",
"loadPerConnection", "loadPerSubscriber" })
public ServerLoadData(float connectionLoad, float subscriberLoad,
float loadPerConnection, float loadPerSubscriber) {
this.connectionLoad = connectionLoad;
this.subscriberLoad = subscriberLoad;
this.loadPerConnection = loadPerConnection;
this.loadPerSubscriber = loadPerSubscriber;
}
@ConstructorProperties({"a", "b", "c", "d"})
public Ambiguous(byte a, short b, int c, long d) {}
@SqeDescriptorKey("TWO PARAMETERS CONSTRUCTOR Simple")
@ConstructorProperties({"unused1", "unused2"})
public Simple(@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused1")int unused1,
@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused2")int unused2) {
}
@SqeDescriptorKey("ONE PARAMETER CONSTRUCTOR Described")
@ConstructorProperties({"name", "unused"})
public Described(@SqeDescriptorKey("CONSTRUCTOR PARAMETER name")String name,
@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused")String unused) {
this.name = name ;
}
@ConstructorProperties({"oldInt", "newString", "newerList"})
public Evolve(int oldInt, String newString, List<String> newerList) {
this.oldInt = oldInt;
this.newString = newString;
this.newerList = newerList;
}
@ConstructorProperties("owner")
public Document(Owner owner) {
this.owner = owner;
}
@ConstructorProperties({"b", "c"})
public Unambiguous(short b, int c) {}
@ConstructorProperties({"oldInt"})
public Evolve(int oldInt) {
this(oldInt, "defaultString");
}
/**
* Constructs a new <code>BasicStroke</code> with the specified
* attributes.
* @param width the width of this <code>BasicStroke</code>. The
* width must be greater than or equal to 0.0f. If width is
* set to 0.0f, the stroke is rendered as the thinnest
* possible line for the target device and the antialias
* hint setting.
* @param cap the decoration of the ends of a <code>BasicStroke</code>
* @param join the decoration applied where path segments meet
* @param miterlimit the limit to trim the miter join. The miterlimit
* must be greater than or equal to 1.0f.
* @param dash the array representing the dashing pattern
* @param dash_phase the offset to start the dashing pattern
* @throws IllegalArgumentException if <code>width</code> is negative
* @throws IllegalArgumentException if <code>cap</code> is not either
* CAP_BUTT, CAP_ROUND or CAP_SQUARE
* @throws IllegalArgumentException if <code>miterlimit</code> is less
* than 1 and <code>join</code> is JOIN_MITER
* @throws IllegalArgumentException if <code>join</code> is not
* either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER
* @throws IllegalArgumentException if <code>dash_phase</code>
* is negative and <code>dash</code> is not <code>null</code>
* @throws IllegalArgumentException if the length of
* <code>dash</code> is zero
* @throws IllegalArgumentException if dash lengths are all zero.
*/
@ConstructorProperties({ "lineWidth", "endCap", "lineJoin", "miterLimit", "dashArray", "dashPhase" })
public BasicStroke(float width, int cap, int join, float miterlimit,
float dash[], float dash_phase) {
if (width < 0.0f) {
throw new IllegalArgumentException("negative width");
}
if (cap != CAP_BUTT && cap != CAP_ROUND && cap != CAP_SQUARE) {
throw new IllegalArgumentException("illegal end cap value");
}
if (join == JOIN_MITER) {
if (miterlimit < 1.0f) {
throw new IllegalArgumentException("miter limit < 1");
}
} else if (join != JOIN_ROUND && join != JOIN_BEVEL) {
throw new IllegalArgumentException("illegal line join value");
}
if (dash != null) {
if (dash_phase < 0.0f) {
throw new IllegalArgumentException("negative dash phase");
}
boolean allzero = true;
for (int i = 0; i < dash.length; i++) {
float d = dash[i];
if (d > 0.0) {
allzero = false;
} else if (d < 0.0) {
throw new IllegalArgumentException("negative dash length");
}
}
if (allzero) {
throw new IllegalArgumentException("dash lengths all zero");
}
}
this.width = width;
this.cap = cap;
this.join = join;
this.miterlimit = miterlimit;
if (dash != null) {
this.dash = (float []) dash.clone();
}
this.dash_phase = dash_phase;
}
@ConstructorProperties({"a", "b", "c"})
public Unambiguous(byte a, short b, int c) {}
@ConstructorProperties({"borderInsets"})
public EmptyBorderUIResource(Insets insets) {
super(insets);
}
@ConstructorProperties("owner")
public Author(Owner<Author> owner) {
this.owner = owner;
this.id = owner.getId();
}
@SqeDescriptorKey("TWO PARAMETERS CONSTRUCTOR Simple")
@ConstructorProperties({"unused1", "unused2"})
public Simple(@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused1")int unused1,
@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused2")int unused2) {
}
@ConstructorProperties({"borderInsets"})
public EmptyBorderUIResource(Insets insets) {
super(insets);
}