192 break; 193 } 194 totalTextWidth += nextCharWidth; 195 } 196 text = text.substring(0, nChars) + clipString; 197 } 198 199 if (!wasTextShortened) { 200 // center it! 201 startXPosition = (totalWidth - (totalTextWidth + iconWidth)) / 2; 202 if (startXPosition < fThisLeftSideTotal) { 203 startXPosition = fThisLeftSideTotal; 204 } 205 } 206 207 if (isSelected || fIsUtility) { 208 g.setColor(Color.lightGray); 209 } else { 210 g.setColor(Color.white); 211 } 212 SwingUtilities2.drawString(frame, g, text, x + startXPosition + iconWidth, y + baseline + 1); 213 214 if (isSelected || fIsUtility) { 215 g.setColor(selectedTextColor); 216 } else { 217 g.setColor(notSelectedTextColor); 218 } 219 220 SwingUtilities2.drawString(frame, g, text, x + startXPosition + iconWidth, y + baseline); 221 g.setFont(f); 222 } 223 224 // sja fix x & y 225 final int iconYPostion = (metrics.titleBarHeight - getIconHeight(frame)) / 2; 226 paintTitleIcon(g, frame, x + startXPosition, y + iconYPostion); 227 } 228 229 public int getWhichButtonHit(final JInternalFrame frame, final int x, final int y) { 230 int buttonHit = -1; 231 232 final Insets i = frame.getInsets(); 233 int startX = i.left + metrics.leftSidePadding - 1; 234 if (isInsideYButtonArea(i, y) && x >= startX) { 235 if (x <= (startX + metrics.buttonWidth)) { 236 if (frame.isClosable()) { 237 buttonHit = kCloseButton; 238 } 239 } else { 240 startX += metrics.buttonWidth + metrics.buttonPadding; | 192 break; 193 } 194 totalTextWidth += nextCharWidth; 195 } 196 text = text.substring(0, nChars) + clipString; 197 } 198 199 if (!wasTextShortened) { 200 // center it! 201 startXPosition = (totalWidth - (totalTextWidth + iconWidth)) / 2; 202 if (startXPosition < fThisLeftSideTotal) { 203 startXPosition = fThisLeftSideTotal; 204 } 205 } 206 207 if (isSelected || fIsUtility) { 208 g.setColor(Color.lightGray); 209 } else { 210 g.setColor(Color.white); 211 } 212 SwingUtilities2.getTextUIDrawing(frame) 213 .drawString(frame, g, text, 214 x + startXPosition + iconWidth, 215 y + baseline + 1); 216 217 if (isSelected || fIsUtility) { 218 g.setColor(selectedTextColor); 219 } else { 220 g.setColor(notSelectedTextColor); 221 } 222 223 SwingUtilities2.getTextUIDrawing(frame) 224 .drawString(frame, g, text, 225 x + startXPosition + iconWidth, 226 y + baseline); 227 g.setFont(f); 228 } 229 230 // sja fix x & y 231 final int iconYPostion = (metrics.titleBarHeight - getIconHeight(frame)) / 2; 232 paintTitleIcon(g, frame, x + startXPosition, y + iconYPostion); 233 } 234 235 public int getWhichButtonHit(final JInternalFrame frame, final int x, final int y) { 236 int buttonHit = -1; 237 238 final Insets i = frame.getInsets(); 239 int startX = i.left + metrics.leftSidePadding - 1; 240 if (isInsideYButtonArea(i, y) && x >= startX) { 241 if (x <= (startX + metrics.buttonWidth)) { 242 if (frame.isClosable()) { 243 buttonHit = kCloseButton; 244 } 245 } else { 246 startX += metrics.buttonWidth + metrics.buttonPadding; |