code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public NYTCorpusDocument parseNYTCorpusDocumentFromFile(File file,
boolean validating) {
Document document = null;
if (validating) {
document = loadValidating(file);
} else {
document = loadNonValidating(file);
}
return parseNYTCorpusDocumentFromDOMDocument(file, document);
} | java |
private Document loadNonValidating(InputStream is) {
Document document;
StringBuffer sb = new StringBuffer();
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(is, "UTF8"));
String line = null;
while ((line = in.readLine()) != null) {
sb.append(line ... | java |
private Document parseStringToDOM(String s, String encoding) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
factory.setValidating(false);
InputStream is = new ByteArrayInputStream(s.getBytes(encoding));
Document doc = factory.newDocumentBuilder().pa... | java |
private Document getDOMObject(String filename, boolean validating)
throws SAXException, IOException, ParserConfigurationException {
// Create a builder factory
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
if (!validating) {
factory.setValidating(validating);
factory.setSchema(... | java |
@Pure
@SuppressWarnings("unchecked")
public Class<? extends T> getValueType() {
if (this.object == null) {
return null;
}
return (Class<? extends T>) this.object.getClass();
} | java |
public void add(T newValue) {
if (this.isSet) {
if (!this.isMultiple
&& newValue != this.object && (newValue == null || !newValue.equals(this.object))) {
this.isMultiple = true;
this.object = null;
}
} else {
this.object = newValue;
this.isSet = true;
this.isMultiple = false;
}
} | java |
public String commandsWritingDataTo(File dataDirectory) throws IOException {
final Map<DatafileReference, File> refsToFiles = Maps.newHashMap();
for (final DatafileReference datafileReference : datafileReferences) {
final File randomFile = File.createTempFile("plotBundle", ".dat", dataDirectory);
ra... | java |
public void setCodePage(DBaseCodePage code) {
if (this.columns != null) {
throw new IllegalStateException();
}
if (code != null) {
this.language = code;
}
} | java |
@SuppressWarnings("checkstyle:magicnumber")
private void writeDBFDate(Date date) throws IOException {
final SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
writeDBFString(format.format(date), 8, (byte) ' ');
} | java |
private static int computeFieldSize(AttributeValue value) throws DBaseFileException, AttributeException {
final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(value.getType());
return dbftype.getFieldSize(value.getString());
} | java |
private static int computeDecimalSize(AttributeValue value) throws DBaseFileException, AttributeException {
final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(value.getType());
return dbftype.getDecimalPointPosition(value.getString());
} | java |
@Pure
public static boolean isSupportedType(DBaseFieldType type) {
return (type != DBaseFieldType.BINARY)
&& (type != DBaseFieldType.GENERAL)
&& (type != DBaseFieldType.MEMORY)
&& (type != DBaseFieldType.PICTURE)
&& (type != DBaseFieldType.VARIABLE);
} | java |
@SuppressWarnings("checkstyle:magicnumber")
private List<DBaseFileField> extractColumns(List<? extends AttributeProvider> providers)
throws DBaseFileException, AttributeException {
final Map<String, DBaseFileField> attributeColumns = new TreeMap<>();
DBaseFileField oldField;
String name;
String kname;
int... | java |
public void writeHeader(List<? extends AttributeProvider> providers) throws IOException, AttributeException {
if (this.columns == null) {
this.columns = extractColumns(providers);
writeDescriptionHeader(providers.size());
writeColumns();
}
} | java |
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:magicnumber"})
public void writeRecord(AttributeProvider element) throws IOException, AttributeException {
if (this.columns == null) {
throw new MustCallWriteHeaderFunctionException();
}
//Field deleted flag (value : 2Ah (*) => Record is dele... | java |
public void write(AttributeProvider... providers) throws IOException, AttributeException {
writeHeader(providers);
for (final AttributeProvider provider : providers) {
writeRecord(provider);
}
close();
} | java |
@Override
@SuppressWarnings("checkstyle:magicnumber")
public void close() throws IOException {
if (this.stream != null) {
//End of file (1Ah)
this.stream.write(0x1A);
this.stream.close();
this.stream = null;
}
if (this.columns != null) {
this.columns.clear();
this.columns = null;
}
} | java |
@Pure
public final N getChildAt(BinaryTreeZone index) {
switch (index) {
case LEFT:
return this.left;
case RIGHT:
return this.right;
default:
throw new IndexOutOfBoundsException();
}
} | java |
public boolean setRightChild(N newChild) {
final N oldChild = this.right;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(1, oldChild);
}
if (newChild != null) {
final N oldPa... | java |
public final boolean setChildAt(BinaryTreeZone zone, N newChild) {
switch (zone) {
case LEFT:
return setLeftChild(newChild);
case RIGHT:
return setRightChild(newChild);
default:
throw new IndexOutOfBoundsException();
}
} | java |
public void add(final String key, final String value)
{
data.setProperty(key, value);
fireTableDataChanged();
} | java |
@Override
protected HashMap readFile(HashMap brMap) throws IOException {
HashMap ret = new HashMap();
ArrayList<HashMap> files = readDailyData(brMap, new HashMap());
// compressData(files);
ret.put("weathers", files);
return ret;
} | java |
@Pure
public void getTranslationVector(Tuple2D<?> translation) {
assert translation != null : AssertMessages.notNullParameter();
translation.set(this.m02, this.m12);
} | java |
@SuppressWarnings("checkstyle:magicnumber")
protected void getScaleRotate2x2(double[] scales, double[] rots) {
final double[] tmp = new double[9];
tmp[0] = this.m00;
tmp[1] = this.m01;
tmp[2] = 0;
tmp[3] = this.m10;
tmp[4] = this.m11;
tmp[5] = 0;
tmp[6] = 0;
tmp[7] = 0;
tmp[8] = 0;
computeSVD... | java |
@Pure
@SuppressWarnings("checkstyle:magicnumber")
public double getRotation() {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
if (Math.signum(tmpRot[0]) != Math.signum(tmpRot[4])) {
// Sinuses are on the top-left to bottom-right diagona... | java |
@SuppressWarnings("checkstyle:magicnumber")
public void setRotation(double angle) {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
final double cos = Math.cos(angle);
final double sin = Math.sin(angle);
// R * S
this.m00 = tmpScale[0] ... | java |
@Pure
@SuppressWarnings("checkstyle:magicnumber")
public double getScale() {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
return MathUtil.max(tmpScale);
} | java |
@Pure
@SuppressWarnings("checkstyle:magicnumber")
public void getScaleVector(Tuple2D<?> scale) {
assert scale != null : AssertMessages.notNullParameter();
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
scale.set(tmpScale[0], tmpScale[1]);... | java |
@SuppressWarnings("checkstyle:magicnumber")
public void setScale(double scaleX, double scaleY) {
final double[] tmpScale = new double[3];
final double[] tmpRot = new double[9];
getScaleRotate2x2(tmpScale, tmpRot);
this.m00 = tmpRot[0] * scaleX;
this.m01 = tmpRot[1] * scaleY;
this.m10 = tmpRot[3] * scaleX;
... | java |
public void setScale(Tuple2D<?> tuple) {
assert tuple != null : AssertMessages.notNullParameter();
setScale(tuple.getX(), tuple.getY());
} | java |
public void makeRotationMatrix(double angle) {
final double sinAngle = Math.sin(angle);
final double cosAngle = Math.cos(angle);
this.m00 = cosAngle;
this.m01 = -sinAngle;
this.m02 = 0.;
this.m11 = cosAngle;
this.m10 = sinAngle;
this.m12 = 0.;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | java |
public void makeTranslationMatrix(double dx, double dy) {
this.m00 = 1.;
this.m01 = 0.;
this.m02 = dx;
this.m10 = 0.;
this.m11 = 1.;
this.m12 = dy;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | java |
public void makeScaleMatrix(double scaleX, double scaleY) {
this.m00 = scaleX;
this.m01 = 0.;
this.m02 = 0.;
this.m10 = 0.;
this.m11 = scaleY;
this.m12 = 0.;
this.m20 = 0.;
this.m21 = 0.;
this.m22 = 1.;
} | java |
public void transform(Tuple2D<?> tuple, Tuple2D<?> result) {
assert tuple != null : AssertMessages.notNullParameter(0);
assert result != null : AssertMessages.notNullParameter(1);
result.set(
this.m00 * tuple.getX() + this.m01 * tuple.getY() + this.m02,
this.m10 * tuple.getX() + this.m11 * tuple.getY() + ... | java |
protected void initializeButton(final Button button, final Color foreground,
final Color background)
{
button.setForeground(foreground);
button.setBackground(background);
} | java |
private void initializeButtons()
{
initializeButton(button1 = new Button("1"), Color.black, Color.lightGray);
initializeButton(button2 = new Button("2"), Color.black, Color.lightGray);
initializeButton(button3 = new Button("3"), Color.black, Color.lightGray);
initializeButton(button4 = new Button("4"), Color.b... | java |
public void connectBeginToBegin(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setBegin(point);
segment.setBegin(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(... | java |
public void connectBeginToEnd(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setBegin(point);
segment.setEnd(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(-1);... | java |
public void connectEndToEnd(SGraphSegment segment) {
if (segment.getGraph() != getGraph()) {
throw new IllegalArgumentException();
}
final SGraphPoint point = new SGraphPoint(getGraph());
setEnd(point);
segment.setEnd(point);
final SGraph g = getGraph();
assert g != null;
g.updatePointCount(-1);
} | java |
public void disconnectBegin() {
if (this.startPoint != null) {
this.startPoint.remove(this);
}
this.startPoint = new SGraphPoint(getGraph());
this.startPoint.add(this);
} | java |
public void disconnectEnd() {
if (this.endPoint != null) {
this.endPoint.remove(this);
}
this.endPoint = new SGraphPoint(getGraph());
this.endPoint.add(this);
} | java |
public boolean addUserData(Object userData) {
if (this.userData == null) {
this.userData = new ArrayList<>();
}
return this.userData.add(userData);
} | java |
@Pure
public Object getUserDataAt(int index) {
if (this.userData == null) {
throw new IndexOutOfBoundsException();
}
return this.userData.get(index);
} | java |
public void setUserDataAt(int index, Object data) {
if (this.userData == null) {
throw new IndexOutOfBoundsException();
}
this.userData.set(index, data);
} | java |
@Pure
public Collection<Object> getAllUserData() {
if (this.userData == null) {
return Collections.emptyList();
}
return Collections.unmodifiableCollection(this.userData);
} | java |
public static void displayUsage(String cmdLineSyntax, Options options) {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp(cmdLineSyntax, options);
} | java |
private Graphics2D initGraphics2D(final Graphics g)
{
Graphics2D g2;
g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2.setColor(this.color);
return g2... | java |
@Override
public T decode(final String s) {
checkNotNull(s);
try {
return Enum.valueOf(type, s);
} catch (final IllegalArgumentException ignored) {
}
try {
return Enum.valueOf(type, s.toUpperCase());
} catch (final IllegalArgumentException ignored) {
}
try {
return En... | java |
@Pure
protected int compareConnections(PT p1, PT p2) {
assert p1 != null && p2 != null;
return p1.hashCode() - p2.hashCode();
} | java |
public void addAllLeftRowsToRightTable()
{
rightTable.getGenericTableModel().addList(leftTable.getGenericTableModel().getData());
leftTable.getGenericTableModel().clear();
} | java |
public void addAllRightRowsToLeftTable()
{
leftTable.getGenericTableModel().addList(rightTable.getGenericTableModel().getData());
rightTable.getGenericTableModel().clear();
} | java |
public void shuffleSelectedLeftRowsToRightTable()
{
final int[] selectedRows = leftTable.getSelectedRows();
final int lastIndex = selectedRows.length - 1;
for (int i = lastIndex; -1 < i; i--)
{
final int selectedRow = selectedRows[i];
final T row = leftTable.getGenericTableModel().removeAt(selecte... | java |
public static List<String> loadOptions(String optionFileName) {
List<String> args = new ArrayList<String>();
File optionFile = new File(optionFileName);
StringWriter stringWriter = new StringWriter();
try {
InputStream inputStream = new FileInputStream(optionFile);
IOUtils.copy(inputSt... | java |
@Pure
public static boolean isShapeFile(URL file) {
return FileType.isContentType(
file,
MimeName.MIME_SHAPE_FILE.getMimeConstant());
} | java |
@SuppressWarnings("static-method")
@Provides
@Singleton
public HelpGenerator provideHelpGenerator(
ApplicationMetadata metadata, Injector injector, Terminal terminal) {
int maxColumns = terminal.getColumns();
if (maxColumns < TTY_MIN_COLUMNS) {
maxColumns = TTY_DEFAULT_COLUMNS;
}
String argumentSynopsi... | java |
public ZoomableGraphicsContext getDocumentGraphicsContext2D() {
if (this.documentGraphicsContext == null) {
final CenteringTransform transform = new CenteringTransform(
invertedAxisXProperty(),
invertedAxisYProperty(),
viewportBoundsProperty());
this.documentGraphicsContext = new ZoomableGraphics... | java |
protected void fireDrawingStart() {
final ListenerCollection<EventListener> list = this.listeners;
if (list != null) {
for (final DrawingListener listener : list.getListeners(DrawingListener.class)) {
listener.onDrawingStart();
}
}
} | java |
protected void fireDrawingEnd() {
final ListenerCollection<EventListener> list = this.listeners;
if (list != null) {
for (final DrawingListener listener : list.getListeners(DrawingListener.class)) {
listener.onDrawingEnd();
}
}
} | java |
@Pure
public static BusLayerDrawerType getPreferredLineDrawAlgorithm() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
final String algo = prefs.get("DRAWING_ALGORITHM", null); //$NON-NLS-1$
if (algo != null && algo.length() > 0) {
try {
retu... | java |
public static void setPreferredLineDrawingAlgorithm(BusLayerDrawerType algorithm) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (algorithm == null) {
prefs.remove("DRAWING_ALGORITHM"); //$NON-NLS-1$
} else {
prefs.put("DRAWING_ALGORITHM", ... | java |
@Pure
public static int getSelectionColor() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
final String str = prefs.get("SELECTION_COLOR", null); //$NON-NLS-1$
if (str != null) {
try {
return Integer.valueOf(str);
} catch (Throwable exce... | java |
public static void setSelectionColor(Integer color) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (color == null || color == DEFAULT_SELECTION_COLOR) {
prefs.remove("SELECTION_COLOR"); //$NON-NLS-1$
} else {
prefs.put("SELECTION_COLOR", co... | java |
@Pure
public static boolean isBusStopDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_BUS_STOPS", DEFAULT_BUS_STOP_DRAWING); //$NON-NLS-1$
}
return DEFAULT_BUS_STOP_DRAWING;
} | java |
@Pure
public static boolean isBusStopNamesDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_BUS_STOPS_NAMES", DEFAULT_BUS_STOP_NAMES_DRAWING); //$NON-NLS-1$
}
return DEFAULT_BUS_STOP_NAMES_DRAWING;
} | java |
public static void setBusStopNamesDrawable(Boolean isNamesDrawable) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isNamesDrawable == null) {
prefs.remove("DRAW_BUS_STOPS_NAMES"); //$NON-NLS-1$
} else {
prefs.putBoolean("DRAW_BUS_STOPS_NAM... | java |
@Pure
public static boolean isBusStopNoHaltBindingDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_NO_BUS_HALT_BIND", DEFAULT_NO_BUS_HALT_BIND); //$NON-NLS-1$
}
return DEFAULT_NO_BUS_HALT_BIND;
} | java |
public static void setBusStopNoHaltBindingDrawable(Boolean isDrawable) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isDrawable == null) {
prefs.remove("DRAW_NO_BUS_HALT_BIND"); //$NON-NLS-1$
} else {
prefs.putBoolean("DRAW_NO_BUS_HALT_BI... | java |
@Pure
public static boolean isBusStopNoHaltBindingNamesDrawable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("DRAW_NO_BUS_HALT_BIND_NAMES", DEFAULT_NO_BUS_HALT_BIND_NAMES); //$NON-NLS-1$
}
return DEFAULT_NO_BUS_HALT_BIND_... | java |
@Pure
public static boolean isAttributeExhibitable() {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
return prefs.getBoolean("EXHIBIT_ATTRIBUTES", DEFAULT_ATTRIBUTE_EXHIBITION); //$NON-NLS-1$
}
return DEFAULT_ATTRIBUTE_EXHIBITION;
} | java |
public static void setAttributeExhibitable(Boolean isExhibit) {
final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
if (prefs != null) {
if (isExhibit == null) {
prefs.remove("EXHIBIT_ATTRIBUTES"); //$NON-NLS-1$
} else {
prefs.putBoolean("EXHIBIT_ATTRIBUTES", isExhibit.b... | java |
public JsonLdModule configure(ConfigParam param, String value) {
Objects.requireNonNull(param);
configuration.set(param, value);
return this;
} | java |
public boolean setFirstChild(N newChild) {
final N oldChild = this.nNorthWest;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(0, oldChild);
}
if (newChild != null) {
final N ... | java |
public boolean setSecondChild(N newChild) {
final N oldChild = this.nNorthEast;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(1, oldChild);
}
if (newChild != null) {
final N... | java |
public boolean setThirdChild(N newChild) {
final N oldChild = this.nSouthWest;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(2, oldChild);
}
if (newChild != null) {
final N ... | java |
public boolean setFourthChild(N newChild) {
final N oldChild = this.nSouthEast;
if (oldChild == newChild) {
return false;
}
if (oldChild != null) {
oldChild.setParentNodeReference(null, true);
--this.notNullChildCount;
firePropertyChildRemoved(3, oldChild);
}
if (newChild != null) {
final N... | java |
public boolean setChildAt(QuadTreeZone zone, N newChild) {
switch (zone) {
case NORTH_WEST:
return setFirstChild(newChild);
case NORTH_EAST:
return setSecondChild(newChild);
case SOUTH_WEST:
return setThirdChild(newChild);
case SOUTH_EAST:
return setFourthChild(newChild);
default:
}
return f... | java |
@SuppressWarnings({"checkstyle:magicnumber", "checkstyle:cyclomaticcomplexity"})
public boolean remove(Point3D<?, ?> point) {
if (this.types != null && !this.types.isEmpty() && this.coords != null && !this.coords.isEmpty()) {
for (int i = 0, j = 0; i < this.coords.size() && j < this.types.size(); j++) {
final... | java |
public ImmutableListMultimap<Symbol, EDLMention> loadEDLMentionsByDocFrom(CharSource source) throws IOException {
final ImmutableList<EDLMention> edlMentions = loadEDLMentionsFrom(source);
final ImmutableListMultimap.Builder<Symbol, EDLMention> byDocs =
ImmutableListMultimap.<Symbol, EDLMention>builder(... | java |
private void writeSingleExp(String arg0, Map result, DssatCommonOutput output, String file) {
futFiles.put(file, executor.submit(new DssatTranslateRunner(output, result, arg0)));
} | java |
public static Vector3i convert(Tuple3D<?> tuple) {
if (tuple instanceof Vector3i) {
return (Vector3i) tuple;
}
return new Vector3i(tuple.getX(), tuple.getY(), tuple.getZ());
} | java |
@Pure
public static String getFirstFreeBusHubName(BusNetwork busnetwork) {
int nb = busnetwork.getBusHubCount();
String name;
do {
++nb;
name = Locale.getString(
"NAME_TEMPLATE", //$NON-NLS-1$
Integer.toString(nb));
}
while (busnetwork.getBusHub(name) != null);
return name;
} | java |
@Override
@Pure
public GeoLocation getGeoLocation() {
final Rectangle2d b = getBoundingBox();
if (b == null) {
return new GeoLocationNowhere(getUUID());
}
return new GeoLocationPoint(b.getCenterX(), b.getCenterY());
} | java |
@Pure
public double distance(double x, double y) {
double dist = Double.POSITIVE_INFINITY;
if (isValidPrimitive()) {
for (final BusStop stop : this.busStops) {
final double d = stop.distance(x, y);
if (!Double.isNaN(d) && d < dist) {
dist = d;
}
}
}
return Double.isInfinite(dist) ? Doubl... | java |
boolean addBusStop(BusStop busStop, boolean fireEvents) {
if (busStop == null) {
return false;
}
if (this.busStops.indexOf(busStop) != -1) {
return false;
}
if (!this.busStops.add(busStop)) {
return false;
}
busStop.addBusHub(this);
resetBoundingBox();
if (fireEvents) {
firePrimitiveChange... | java |
public void removeAllBusStops() {
for (final BusStop busStop : this.busStops) {
busStop.removeBusHub(this);
}
this.busStops.clear();
resetBoundingBox();
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.ALL_STOPS_REMOVED,
null,
-1,
null,
null,
null));
checkPrimitive... | java |
public boolean removeBusStop(BusStop busStop) {
final int index = this.busStops.indexOf(busStop);
if (index >= 0) {
this.busStops.remove(index);
busStop.removeBusHub(this);
resetBoundingBox();
firePrimitiveChanged(new BusChangeEvent(this,
BusChangeEventType.STOP_REMOVED,
busStop,
index,
... | java |
@Pure
public BusStop[] busStopsArray() {
return Collections.unmodifiableList(this.busStops).toArray(new BusStop[this.busStops.size()]);
} | java |
protected void defineSmallRectangle(ZoomableGraphicsContext gc, T element) {
final double ptsSize = element.getPointSize() / 2.;
final double x = element.getX() - ptsSize;
final double y = element.getY() - ptsSize;
final double mx = element.getX() + ptsSize;
final double my = element.getY() + ptsSize;
gc.mo... | java |
@Override
public final void setUUID(UUID id) {
final UUID oldId = getUUID();
if ((oldId != null && !oldId.equals(id)) || (oldId == null && id != null)) {
super.setUUID(oldId);
fireElementChanged();
}
} | java |
public final void addLayerListener(MapLayerListener listener) {
if (this.listeners == null) {
this.listeners = new ListenerCollection<>();
}
this.listeners.add(MapLayerListener.class, listener);
} | java |
public final void removeLayerListener(MapLayerListener listener) {
if (this.listeners != null) {
this.listeners.remove(MapLayerListener.class, listener);
if (this.listeners.isEmpty()) {
this.listeners = null;
}
}
} | java |
@Override
public void onAttributeChangeEvent(AttributeChangeEvent event) {
super.onAttributeChangeEvent(event);
fireLayerAttributeChangedEvent(new MapLayerAttributeChangeEvent(this, event));
fireElementChanged();
if (ATTR_VISIBLE.equals(event.getName())) {
final AttributeValue nValue = event.getValue();
... | java |
@Pure
public boolean isClickable() {
final AttributeValue val = getAttributeProvider().getAttribute(ATTR_CLICKABLE);
if (val != null) {
try {
return val.getBoolean();
} catch (AttributeException e) {
//
}
}
return true;
} | java |
@Pure
public final boolean isTemporaryLayer() {
MapLayer layer = this;
GISLayerContainer<?> container;
while (layer != null) {
if (layer.isTemp) {
return true;
}
container = layer.getContainer();
layer = container instanceof MapLayer ? (MapLayer) container : null;
}
return false;
} | java |
@Pure
public boolean isRemovable() {
final AttributeValue val = getAttributeProvider().getAttribute(ATTR_REMOVABLE);
if (val != null) {
try {
return val.getBoolean();
} catch (AttributeException e) {
//
}
}
return true;
} | java |
public void setProperties(Point3d center, DoubleProperty radius1) {
setProperties(center.xProperty,center.yProperty,center.zProperty, radius1);
} | java |
@Pure
public Point3f getCenterWithoutProperties() {
return new Point3f(this.cxProperty.doubleValue(), this.cyProperty.doubleValue(), this.czProperty.doubleValue());
} | java |
public void setCenterProperties(Point3d center) {
this.cxProperty = center.xProperty;
this.cyProperty = center.yProperty;
this.czProperty = center.zProperty;
} | java |
public void setCenterProperties(DoubleProperty x, DoubleProperty y, DoubleProperty z) {
this.cxProperty = x;
this.cyProperty = y;
this.czProperty = z;
} | java |
public void setRadiusProperty(DoubleProperty radius1) {
this.radiusProperty = radius1;
this.radiusProperty.set(Math.abs(this.radiusProperty.get()));
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.