Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug: #1266 Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
- Loading branch information
1 parent
fbc4946
commit 2924c87
Showing
58 changed files
with
3,551 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...src/main/java/org/eclipse/sirius/components/charts/barchart/components/BarChartStyle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.components.charts.barchart.components; | ||
|
||
import java.text.MessageFormat; | ||
import java.util.Objects; | ||
|
||
/** | ||
* The style of a BarChart. | ||
* | ||
* @author fbarbin | ||
*/ | ||
public final class BarChartStyle { | ||
|
||
private String barsColor; | ||
|
||
private BarChartStyle() { | ||
// prevent instantiation | ||
} | ||
|
||
public String getBarsColor() { | ||
return this.barsColor; | ||
} | ||
|
||
public static Builder newBarChartStyle() { | ||
return new Builder(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
String pattern = "{0} '{'barsColor: {1}'}'"; //$NON-NLS-1$ | ||
return MessageFormat.format(pattern, this.getClass().getSimpleName(), this.barsColor); | ||
} | ||
|
||
/** | ||
* Builder used to create the BarChart style. | ||
* | ||
* @author fbarbin | ||
*/ | ||
@SuppressWarnings("checkstyle:HiddenField") | ||
public static final class Builder { | ||
private String barsColor; | ||
|
||
public Builder barsColor(String barsColor) { | ||
this.barsColor = Objects.requireNonNull(barsColor); | ||
return this; | ||
} | ||
|
||
public BarChartStyle build() { | ||
BarChartStyle barChartStyle = new BarChartStyle(); | ||
barChartStyle.barsColor = this.barsColor; // optional. | ||
return barChartStyle; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.