org.pepstock.charba.client.colors.tiles.VerticalLine Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of charba Show documentation
Show all versions of charba Show documentation
Charba - J2CL and GWT charts library based on CHART.JS
/**
Copyright 2017 Andrea "Stock" Stocchero
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.pepstock.charba.client.colors.tiles;
import org.pepstock.charba.client.dom.elements.Context2dItem;
/**
* LINE (vertically) drawer to design a line (vertically) into tile.
* It designs a line (vertically) into the following tile sections (A and B):
*
*
*
* +---------+---------+
* | | |
* | A | |
* | | |
* +---------+---------+
* | | |
* | | B |
* | | |
* +---------+---------+
*
*
* @author Andrea "Stock" Stocchero
*
*/
final class VerticalLine extends Line {
/*
* (non-Javadoc)
*
* @see org.pepstock.charba.client.colors.tiles.ShapeDrawer#drawTile(org.pepstock.charba.client.dom.Context2dItem, java.lang.String, java.lang.String, int)
*/
@Override
protected void drawTile(Context2dItem context, String backgroundColor, String shapeColor, int size) {
// applies a translation to the current transform
context.translate(size, 0D);
// applies rotation (90 degrees) to the current transform
context.rotate(ROTATION_90_DEGREES);
// invoke the line shape drawer
// which will design the line vertically
super.drawTile(context, backgroundColor, shapeColor, size);
}
}