16 package net.squiz.matrix.matrixtree;
18 import net.squiz.matrix.core.*;
22 private int parentTotalAssets,currentAssetsCount,viewedAssetsCount = 0;
23 private int clicks = 0;
24 private int names = 4;
25 private int initStrWidth = 0;
26 private int firstNameLength = 0;
27 private String cueModeName =
"";
30 super(null,
"", 1,
"",
"",
"", 0);
33 public void setParentTotalAssets(
int parentTotalAssets) {
34 this.parentTotalAssets = parentTotalAssets;
37 public void setCurrentAssetsCount(
int currentAssetsCount) {
38 this.currentAssetsCount = currentAssetsCount;
41 public void setViewedAssetsCount(
int viewedAssetsCount) {
42 this.viewedAssetsCount = viewedAssetsCount;
45 public int getParentTotalAssets() {
46 return parentTotalAssets;
49 public int getCurrentAssetsCount() {
50 return currentAssetsCount;
53 public int getViewedAssetsCount() {
54 return viewedAssetsCount;
58 public int getCurrentLoc() {
60 currentLoc = viewedAssetsCount;
65 public int getInitStrWidth() {
69 public void setInitStrWidth(
int width) {
70 if (width > initStrWidth) {
75 private void setfirstNameLength(
int length) {
76 firstNameLength = length;
79 private int getFirstNameLength() {
80 return firstNameLength;
83 public void setClicks(
int clicks) {
87 public int getClicks() {
91 public String getName() {
92 int to = getCurrentLoc()+AssetManager.getLimit();
93 if ((to > getParentTotalAssets()) && getParentTotalAssets() > 0) {
94 to = getParentTotalAssets();
97 if (getParentTotalAssets() > 0) {
98 total = getParentTotalAssets();
101 if (getClicks() == 0 || names < getClicks()) {
106 if (getClicks() == 1) {
107 String totalStr =
"N/A";
108 String fromStr =
""+(getCurrentLoc()+1);
109 String toStr =
""+to;
114 Object[] transArgs = {
120 name = Matrix.translate(
"asset_map_expanding_node_one",transArgs);
121 setfirstNameLength(name.length());
122 }
if (getClicks() == 2) {
123 String fromStr =
""+((int)((getCurrentLoc()+1)/AssetManager.getLimit())+1);
124 String toStr =
"N/A";
126 toStr =
""+((int)(total/AssetManager.getLimit())+1);
128 Object[] transArgs = {
132 name = Matrix.translate(
"asset_map_expanding_node_two",transArgs);
133 }
else if (getClicks() == 3) {
134 String totalStr =
"N/A";
138 Object[] transArgs = {
141 name = Matrix.translate(
"asset_map_expanding_node_three",transArgs);
142 }
else if (getClicks() == 4) {
143 int remaining = (total-getCurrentLoc()-AssetManager.getLimit());
144 String remainingStr =
"0";
146 remainingStr =
""+remaining;
148 Object[] transArgs = {
151 name = Matrix.translate(
"asset_map_expanding_node_four",transArgs);
153 if (getFirstNameLength() > name.length()) {
154 int diff = getFirstNameLength() - name.length();
155 for (
int i=0; i< diff+4;i++) {
164 public void setCueModeName(String name) {
168 public String getCueModeName() {
172 public String getAssetName() {
176 public boolean usingCueModeName() {
177 return getAssetName().equals(getCueModeName());
180 public void useCueModeName() {
181 setName(getCueModeName());
184 public void setName(String name) {
188 public void switchName() {
193 public void switchName(
int evtX,
double boundsX) {
194 int res = evtX - (int)boundsX;
196 setClicks(getClicks()+1);
209 public String getName() {
213 public void setName(String name) {