/** * 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); installPropertyChangeListeners(); }
/** * 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); }
/** * 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); }
/** * * This constructor is to be used by internal JMX framework only. User should not try to create an * instance of this class. */ @ConstructorProperties({"maxFileDescriptorCount", "openFileDescriptorCount", "processCpuTime", "committedVirtualMemorySize", "totalPhysicalMemorySize", "freePhysicalMemorySize", "totalSwapSpaceSize", "freeSwapSpaceSize", "name", "version", "arch", "availableProcessors", "systemLoadAverage" }) public OSMetrics(long maxFileDescriptorCount, long openFileDescriptorCount, long processCpuTime, long committedVirtualMemorySize, long totalPhysicalMemorySize, long freePhysicalMemorySize, long totalSwapSpaceSize, long freeSwapSpaceSize, String name, String version, String arch, int availableProcessors, double systemLoadAverage) { this.maxFileDescriptorCount = maxFileDescriptorCount; this.openFileDescriptorCount = openFileDescriptorCount; this.processCpuTime = processCpuTime; this.committedVirtualMemorySize = committedVirtualMemorySize; this.totalPhysicalMemorySize = totalPhysicalMemorySize; this.freePhysicalMemorySize = freePhysicalMemorySize; this.totalSwapSpaceSize = totalSwapSpaceSize; this.freeSwapSpaceSize = freeSwapSpaceSize; this.name = name; this.version = version; this.arch = arch; this.availableProcessors = availableProcessors; this.systemLoadAverage = systemLoadAverage; }
/** * 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({"activeThreadCount","currentThreadPoolSize","largestThreadPoolSize", "maxThreadPoolSize","currentQueueSize","largestQueueSize","maxQueueSize", "completedTaskCount","totalTaskCount","rejectedTaskCount"}) public ThreadExecutorStats(long activeThreadCount, long currentThreadPoolSize, long largestThreadPoolSize, long maxThreadPoolSize, long currentQueueSize, Long largestQueueSize, long maxQueueSize, long completedTaskCount, long totalTaskCount, Long rejectedTaskCount) { this.activeThreadCount = activeThreadCount; this.currentThreadPoolSize = currentThreadPoolSize; this.largestQueueSize = largestQueueSize; this.largestThreadPoolSize = largestThreadPoolSize; this.maxThreadPoolSize = maxThreadPoolSize; this.currentQueueSize = currentQueueSize; this.maxQueueSize = maxQueueSize; this.completedTaskCount = completedTaskCount; this.totalTaskCount = totalTaskCount; this.rejectedTaskCount = rejectedTaskCount; }
@ConstructorProperties({"file", "name", "author", "version", "description", "website"}) public PluginDescription(File file, String name, List<String> author, String version, String description, String website) { this.file = file; this.name = name; this.author = author; this.version = version; this.description = description; this.website = website; }
@ConstructorProperties ( { "label", "current", "minimum", "maximum" } ) public StatisticInformation ( final String label, final Double current, final Double minimum, final Double maximum ) { super (); this.label = label; this.current = current; this.minimum = minimum; this.maximum = maximum; }
public static String[] evaluate(Constructor<?> candidate, int paramCount) { ConstructorProperties cp = candidate.getAnnotation(ConstructorProperties.class); if (cp != null) { String[] names = cp.value(); if (names.length != paramCount) { throw new IllegalStateException("Constructor annotated with @ConstructorProperties but not " + "corresponding to actual number of parameters (" + paramCount + "): " + candidate); } return names; } else { return null; } }
/** * 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]); }
/** * 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 bevel border with the specified type, highlight and * shadow colors. * * @param bevelType the type of bevel for the border * @param highlightOuterColor the color to use for the bevel outer highlight * @param highlightInnerColor the color to use for the bevel inner highlight * @param shadowOuterColor the color to use for the bevel outer shadow * @param shadowInnerColor the color to use for the bevel inner shadow */ @ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"}) public BevelBorder(int bevelType, Color highlightOuterColor, Color highlightInnerColor, Color shadowOuterColor, Color shadowInnerColor) { this(bevelType); this.highlightOuter = highlightOuterColor; this.highlightInner = highlightInnerColor; this.shadowOuter = shadowOuterColor; this.shadowInner = shadowInnerColor; }
@ConstructorProperties({"listener","registeredPath", "isEnabled", "notificationCount"}) public DataTreeListenerInfo(final String listener, final String registeredPath, final boolean isEnabled, final long notificationCount) { this.listener = Preconditions.checkNotNull(listener); this.registeredPath = Preconditions.checkNotNull(registeredPath); this.isEnabled = isEnabled; this.notificationCount = notificationCount; }
/** * Finds the appropriate constructor for the specified type that we will use to construct * instances. */ private static void processPropertyType(final Class<?> propertyType) throws NoSuchMethodException, SecurityException, IntrospectionException { final Class<?> wrappedType = Primitives.wrap(propertyType); if (CONSTRUCTORS.containsKey(wrappedType)) { return; } // If the type is a primitive (or String type), we look for the constructor that takes a // single String argument, which, for primitives, validates and converts from a String // representation which is the form we get on ingress. if (propertyType.isPrimitive() || Primitives.isWrapperType(propertyType) || propertyType.equals(String.class)) { CONSTRUCTORS.put(wrappedType, propertyType.getConstructor(String.class)); } else { // This must be a yang-defined type. We need to find the constructor that takes a // primitive as the only argument. This will be used to construct instances to perform // validation (eg range checking). The yang-generated types have a couple single-argument // constructors but the one we want has the bean ConstructorProperties annotation. for (final Constructor<?> ctor: propertyType.getConstructors()) { final ConstructorProperties ctorPropsAnnotation = ctor.getAnnotation(ConstructorProperties.class); if (ctor.getParameterTypes().length == 1 && ctorPropsAnnotation != null) { findYangTypeGetter(propertyType, ctorPropsAnnotation.value()[0]); CONSTRUCTORS.put(propertyType, ctor); break; } } } }
@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); }
/** * This constructor is to be used by internal JMX framework only. User should not try to create an * instance of this class. */ @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; }
/** * This constructor is to be used by internal JMX framework only. User should not try to create an * instance of this class. */ @ConstructorProperties({"gcCount", "gcTimeMillis", "initMemory", "committedMemory", "usedMemory", "maxMemory", "totalThreads"}) public JVMMetrics(long gcCount, long gcTimeMillis, long initMemory, long committedMemory, long usedMemory, long maxMemory, int totalThreads) { this.gcCount = gcCount; this.gcTimeMillis = gcTimeMillis; this.initMemory = initMemory; this.committedMemory = committedMemory; this.usedMemory = usedMemory; this.maxMemory = maxMemory; this.totalThreads = totalThreads; }
/** * This constructor is to be used by internal JMX framework only. User should not try to create an * instance of this class. */ @ConstructorProperties({"diskDirectory", "offilne" }) public DiskBackupResult(String diskDirectory, boolean offline) { this.diskDirectory = diskDirectory; this.offilne = offline; }
/** * * This constructor is to be used by internal JMX framework only. User should not try to create an * instance of this class. */ @ConstructorProperties({"algorithm", "maximum", "action" }) public EvictionAttributesData(String algorithm, Integer maximum, String action) { this.algorithm = algorithm; this.maximum = maximum; this.action = action; }
/** * Constructs a {@code TitledBorderUIResource}. * @param border the border * @param title the title the border should display * @param titleJustification the justification fro the title * @param titlePosition the position for the title * @param titleFont the font for rendering the title * @param titleColor the color of the title */ @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({"id","nextIndex", "matchIndex", "isActive", "timeSinceLastActivity", "isVoting"}) public FollowerInfo(String id, long nextIndex, long matchIndex, boolean isActive, String timeSinceLastActivity, boolean isVoting) { this.id = id; this.nextIndex = nextIndex; this.matchIndex = matchIndex; this.isActive = isActive; this.timeSinceLastActivity = timeSinceLastActivity; this.isVoting = isVoting; }
@ConstructorProperties(QNAME_ATTR_NAME) public IdentityAttributeRef(final String qualifiedNameOfIdentity) { if (qualifiedNameOfIdentity == null) { throw new NullPointerException("Parameter " + QNAME_ATTR_NAME + " is null"); } this.qualifiedNameOfIdentity = qualifiedNameOfIdentity; }
/** * Creates a {@code TreePath} from an array. The array uniquely * identifies the path to a node. * * @param path an array of objects representing the path to a node * @throws IllegalArgumentException if {@code path} is {@code null}, * empty, or contains a {@code null} value */ @ConstructorProperties({"path"}) public TreePath(Object[] path) { if(path == null || path.length == 0) throw new IllegalArgumentException("path in TreePath must be non null and not empty."); lastPathComponent = path[path.length - 1]; if (lastPathComponent == null) { throw new IllegalArgumentException( "Last path component must be non-null"); } if(path.length > 1) parentPath = new TreePath(path, path.length - 1); }
@ConstructorProperties(value={"text"}) public TextComponent(String text) { this.text = text; }
/** * Equivalent to {@link #FsMountPoint(URI, FsUriModifier) new FsMountPoint(uri, FsUriModifier.NULL)}. */ @ConstructorProperties("uri") public FsMountPoint(URI uri) throws URISyntaxException { parse(uri, NULL); }
/** * 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; }
/** * Constructs a {@code LinearGradientPaint}. * * @param start the gradient axis start {@code Point2D} in user space * @param end the gradient axis end {@code Point2D} in user space * @param fractions numbers ranging from 0.0 to 1.0 specifying the * distribution of colors along the gradient * @param colors array of colors corresponding to each fractional value * @param cycleMethod either {@code NO_CYCLE}, {@code REFLECT}, * or {@code REPEAT} * @param colorSpace which color space to use for interpolation, * either {@code SRGB} or {@code LINEAR_RGB} * @param gradientTransform transform to apply to the gradient * * @throws NullPointerException * if one of the points is null, * or {@code fractions} array is null, * or {@code colors} array is null, * or {@code cycleMethod} is null, * or {@code colorSpace} is null, * or {@code gradientTransform} is null * @throws IllegalArgumentException * if start and end points are the same points, * or {@code fractions.length != colors.length}, * or {@code colors} is less than 2 in size, * or a {@code fractions} value is less than 0.0 or greater than 1.0, * or the {@code fractions} are not provided in strictly increasing order */ @ConstructorProperties({ "startPoint", "endPoint", "fractions", "colors", "cycleMethod", "colorSpace", "transform" }) public LinearGradientPaint(Point2D start, Point2D end, float[] fractions, Color[] colors, CycleMethod cycleMethod, ColorSpaceType colorSpace, AffineTransform gradientTransform) { super(fractions, colors, cycleMethod, colorSpace, gradientTransform); // check input parameters if (start == null || end == null) { throw new NullPointerException("Start and end points must be" + "non-null"); } if (start.equals(end)) { throw new IllegalArgumentException("Start point cannot equal" + "endpoint"); } // copy the points... this.start = new Point2D.Double(start.getX(), start.getY()); this.end = new Point2D.Double(end.getX(), end.getY()); }
@ConstructorProperties("id") public Owner(int id) { this.id = id; }
@ConstructorProperties({"red", "green", "blue"}) public ColorUIResource(int r, int g, int b) { super(r, g, b); }
@ConstructorProperties({"a", "b"}) public Unambiguous(byte a, short b) {}
@ConstructorProperties({"borderInsets"}) public EmptyBorderUIResource(Insets insets) { super(insets); }
@ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"}) public BevelBorderUIResource(int bevelType, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { super(bevelType, highlightOuter, highlightInner, shadowOuter, shadowInner); }
@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 ; }