net.sf.sfac.gui.layout.LineInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfac-core Show documentation
Show all versions of sfac-core Show documentation
This project is the core part of the Swing Framework and Components (SFaC).
It contains the Swing framework classes and the graphical component classes.
The newest version!
/*-------------------------------------------------------------------------
Copyright 2009 Olivier Berlanger
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 net.sf.sfac.gui.layout;
/**
* Info of a row or column.
*
*
* @author Olivier Berlanger
*/
class LineInfo {
private int pos;
private int beforeSpace;
private int space;
private int afterSpace;
private int weightedSpace;
private double weight;
LineInfo() {
}
void reset() {
pos = 0;
beforeSpace = 0;
space = 0;
afterSpace = 0;
weightedSpace = 0;
weight = 0.0;
}
int getPos() {
return pos;
}
void setPos(int p) {
pos = p;
}
int getBeforeSpace() {
return beforeSpace;
}
void setBeforeSpace(int sp) {
beforeSpace = sp;
}
int getSpace() {
return space;
}
void setSpace(int sp) {
space = sp;
}
int getAfterSpace() {
return afterSpace;
}
void setAfterSpace(int sp) {
afterSpace = sp;
}
int getWeightedSpace() {
return weightedSpace;
}
void setWeightedSpace(int sp) {
weightedSpace = sp;
}
double getWeight() {
return weight;
}
void setWeight(double newWeight) {
weight = newWeight;
}
int getTotalSpace() {
return beforeSpace + space + afterSpace;
}
int getLayedTotalSpace() {
return beforeSpace + weightedSpace + afterSpace;
}
int getLayedStart() {
return pos + beforeSpace;
}
int getLayedEnd() {
return pos + beforeSpace + weightedSpace;
}
int getLayedNextPos() {
return pos + beforeSpace + weightedSpace + afterSpace;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy