/** * Get a reference to a label with the given name. * * If a label with that name has not been added yet, a new one is created, but is left * in an unplaced state. It is assumed that addLabel(name) will be called at a later * point to define the location of the label. * * @param name The name of the label to get * @return A LabelRef representing the label */ @Nonnull public Label getLabel(@Nonnull String name) { Label label = labels.get(name); if (label == null) { label = new Label(); labels.put(name, label); } return label; }
@Nonnull public Label addNewLabel() { Label newLabel = new Label(); getLabels().add(newLabel); return newLabel; }
@Nonnull public Label addNewLabel() { Label newLabel = new Label(); getLabels().add(newLabel); return newLabel; }
@Nonnull public Label addNewLabel() { Label label = new Label(this); getLabels(true).add(label); return label; }
/** * Get a reference to a label with the given name. * * If a label with that name has not been added yet, a new one is created, but is left * in an unplaced state. It is assumed that addLabel(name) will be called at a later * point to define the location of the label. * * @param name The name of the label to get * @return A LabelRef representing the label */ @Nonnull public Label getLabel(@Nonnull String name) { Label label = labels.get(name); if (label == null) { label = new Label(); labels.put(name, label); } return label; }
/** * Get a reference to a label with the given name. * * If a label with that name has not been added yet, a new one is created, but is left * in an unplaced state. It is assumed that addLabel(name) will be called at a later * point to define the location of the label. * * @param name The name of the label to get * @return A LabelRef representing the label */ @Nonnull public Label getLabel(@Nonnull String name) { Label label = labels.get(name); if (label == null) { label = new Label(); labels.put(name, label); } return label; }