private DockNode() { station = new SimpleObjectProperty<>(null); floatableProperty = new SimpleBooleanProperty(true); closeableProperty = new SimpleBooleanProperty(true); resizableProperty = new SimpleBooleanProperty(true); maximizableProperty = new SimpleBooleanProperty(true); floatingProperty = new ReadOnlyBooleanWrapper(false); draggingProperty = new ReadOnlyBooleanWrapper(false); resizingProperty = new ReadOnlyBooleanWrapper(false); maximizingProperty = new ReadOnlyBooleanWrapper(false); container = new ReadOnlyObjectWrapper<>(null); }
@Test public void getAuthenticatedConnection() throws IOException { webserver.requireLogin = true; AuthHandler handler = new AuthHandler( new ReadOnlyStringWrapper("localhost:"+webserver.port), new ReadOnlyBooleanWrapper(false), new ReadOnlyStringWrapper(TEST_USER), new ReadOnlyStringWrapper(TEST_PASSWORD) ); CloseableHttpClient client = handler.getAuthenticatedClient(); assertNotNull(client); HttpUriRequest request = new HttpGet("http://localhost:"+webserver.port+"/testUri"); client.execute(request); Header authHeader = webserver.lastRequest.getFirstHeader("Authorization"); assertNotNull(authHeader); String compareToken = "Basic "+Base64.getEncoder().encodeToString((TEST_USER + ":" + TEST_PASSWORD).getBytes()); assertEquals("Auth token should be expected format", authHeader.getValue(), compareToken); }
/** Replies the isPolyline property. * * @return the isPolyline property. */ public BooleanProperty isPolylineProperty() { if (this.isPolyline == null) { this.isPolyline = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_POLYLINE, false); this.isPolyline.bind(Bindings.createBooleanBinding(() -> { boolean first = true; boolean hasOneLine = false; for (final PathElementType type : innerTypesProperty()) { if (first) { if (type != PathElementType.MOVE_TO) { return false; } first = false; } else if (type != PathElementType.LINE_TO) { return false; } else { hasOneLine = true; } } return hasOneLine; }, innerTypesProperty())); } return this.isPolyline; }
/** Replies the isMultiParts property. * * @return the isMultiParts property. */ public BooleanProperty isMultiPartsProperty() { if (this.isMultipart == null) { this.isMultipart = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_MULTIPARTS, false); this.isMultipart.bind(Bindings.createBooleanBinding(() -> { boolean foundOne = false; for (final PathElementType type : innerTypesProperty()) { if (type == PathElementType.MOVE_TO) { if (foundOne) { return true; } foundOne = true; } } return false; }, innerTypesProperty())); } return this.isMultipart; }
/** Replies the isPolygon property. * * @return the isPolygon property. */ public BooleanProperty isPolygonProperty() { if (this.isPolygon == null) { this.isPolygon = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_POLYGON, false); this.isPolygon.bind(Bindings.createBooleanBinding(() -> { boolean first = true; boolean lastIsClose = false; for (final PathElementType type : innerTypesProperty()) { lastIsClose = false; if (first) { if (type != PathElementType.MOVE_TO) { return false; } first = false; } else if (type == PathElementType.MOVE_TO) { return false; } else if (type == PathElementType.CLOSE) { lastIsClose = true; } } return lastIsClose; }, innerTypesProperty())); } return this.isPolygon; }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> fromXProperty().get() == toXProperty().get() && fromYProperty().get() == toYProperty().get() && ctrlX1Property().get() == toXProperty().get() && ctrlY1Property().get() == toYProperty().get() && ctrlX2Property().get() == toXProperty().get() && ctrlY2Property().get() == toYProperty().get(), fromXProperty(), toXProperty(), fromYProperty(), toYProperty())); } return this.isEmpty; }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> MathUtil.isEpsilonEqual(fromXProperty().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(fromYProperty().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(ctrlX1Property().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(ctrlY1Property().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(ctrlX2Property().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(ctrlY2Property().get(), toYProperty().get()), fromXProperty(), toXProperty(), fromYProperty(), toYProperty())); } return this.isEmpty; }
/** Replies the isCurved property. * * @return the isCurved property. */ public BooleanProperty isCurvedProperty() { if (this.isCurved == null) { this.isCurved = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_CURVED, false); this.isCurved.bind(Bindings.createBooleanBinding(() -> { for (final PathElementType type : innerTypesProperty()) { if (type == PathElementType.CURVE_TO || type == PathElementType.QUAD_TO) { return true; } } return false; }, innerTypesProperty())); } return this.isCurved; }
/** Replies the isMultiParts property. * * @return the isMultiParts property. */ public BooleanProperty isMultiPartsProperty() { if (this.isMultiparts == null) { this.isMultiparts = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_MULTIPARTS, false); this.isMultiparts.bind(Bindings.createBooleanBinding(() -> { boolean foundOne = false; for (final PathElementType type : innerTypesProperty()) { if (type == PathElementType.MOVE_TO) { if (foundOne) { return true; } foundOne = true; } } return false; }, innerTypesProperty())); } return this.isMultiparts; }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> MathUtil.isEpsilonEqual(fromXProperty().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(fromYProperty().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(fromZProperty().get(), toZProperty().get()) && MathUtil.isEpsilonEqual(ctrlX1Property().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(ctrlY1Property().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(ctrlZ1Property().get(), toZProperty().get()), fromXProperty(), toXProperty(), fromYProperty(), toYProperty(), fromZProperty(), toZProperty())); } return this.isEmpty; }
@Pure @Override @SuppressWarnings("checkstyle:booleanexpressioncomplexity") public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> MathUtil.isEpsilonEqual(fromXProperty().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(fromYProperty().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(fromZProperty().get(), toZProperty().get()) && MathUtil.isEpsilonEqual(ctrlX1Property().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(ctrlY1Property().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(ctrlZ1Property().get(), toZProperty().get()) && MathUtil.isEpsilonEqual(ctrlX2Property().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(ctrlY2Property().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(ctrlZ2Property().get(), toZProperty().get()), fromXProperty(), toXProperty(), fromYProperty(), toYProperty(), fromZProperty(), toZProperty())); } return this.isEmpty; }
@Before public void setUp() { ApplicationState.getInstance().runningProperty().set(true); handler = new AuthHandler( new ReadOnlyStringWrapper("localhost:" + webserver.port), new ReadOnlyBooleanWrapper(false), new ReadOnlyStringWrapper(TEST_USER), new ReadOnlyStringWrapper(TEST_PASSWORD) ); client = handler.getAuthenticatedClient(); }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY, true); } return this.isEmpty; }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> fromXProperty().get() == toXProperty().get() && fromYProperty().get() == toYProperty().get(), fromXProperty(), toXProperty(), fromYProperty(), toYProperty())); } return this.isEmpty; }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> fromXProperty().get() == toXProperty().get() && fromYProperty().get() == toYProperty().get() && ctrlX1Property().get() == toXProperty().get() && ctrlY1Property().get() == toYProperty().get(), fromXProperty(), toXProperty(), fromYProperty(), toYProperty())); } return this.isEmpty; }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> MathUtil.isEpsilonEqual(fromXProperty().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(fromYProperty().get(), toYProperty().get()), fromXProperty(), toXProperty(), fromYProperty(), toYProperty())); } return this.isEmpty; }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> MathUtil.isEpsilonEqual(fromXProperty().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(fromYProperty().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(ctrlX1Property().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(ctrlY1Property().get(), toYProperty().get()), fromXProperty(), toXProperty(), fromYProperty(), toYProperty())); } return this.isEmpty; }
/** Replies the property that indictes if the triangle's points are defined in a counter-clockwise order. * * @return the ccw property. */ @Pure public ReadOnlyBooleanProperty ccwProperty() { if (this.ccw == null) { this.ccw = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.CCW); this.ccw.bind(Bindings.createBooleanBinding(() -> Triangle2afp.isCCW( getX1(), getY1(), getX2(), getY2(), getX3(), getY3()), x1Property(), y1Property(), x2Property(), y2Property(), x3Property(), y3Property())); } return this.ccw.getReadOnlyProperty(); }
@Pure @Override public BooleanProperty isEmptyProperty() { if (this.isEmpty == null) { this.isEmpty = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_EMPTY); this.isEmpty.bind(Bindings.createBooleanBinding(() -> MathUtil.isEpsilonEqual(fromXProperty().get(), toXProperty().get()) && MathUtil.isEpsilonEqual(fromYProperty().get(), toYProperty().get()) && MathUtil.isEpsilonEqual(fromZProperty().get(), toZProperty().get()), fromXProperty(), toXProperty(), fromYProperty(), toYProperty(), fromZProperty(), toZProperty())); } return this.isEmpty; }