Java Code Examples for com.codename1.ui.TextArea#getAbsoluteY()
The following examples show how to use
com.codename1.ui.TextArea#getAbsoluteY() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InPlaceEditView.java From CodenameOne with GNU General Public License v2.0 | 6 votes |
TextAreaData(TextArea ta) { absoluteX = ta.getAbsoluteX(); absoluteY = ta.getAbsoluteY(); scrollX = ta.getScrollX(); scrollY = ta.getScrollY(); Style s = ta.getStyle(); paddingTop = s.getPaddingTop(); paddingLeft = s.getPaddingLeft(ta.isRTL()); paddingRight = s.getPaddingRight(ta.isRTL()); paddingBottom = s.getPaddingBottom(); isTextField = (ta instanceof TextField); verticalAlignment = ta.getVerticalAlignment(); height = ta.getHeight(); width = ta.getWidth(); fontHeight = s.getFont().getHeight(); textArea = ta; isRTL = ta.isRTL(); nextDown = textArea.getComponentForm().getNextComponent(textArea); isSingleLineTextArea = textArea.isSingleLineTextArea(); hint = ta.getHint(); nativeHintBool = textArea.getUIManager().isThemeConstant("nativeHintBool", false); nativeFont = s.getFont().getNativeFont(); fgColor = s.getFgColor(); maxSize = ta.getMaxSize(); }
Example 2
Source File: InPlaceEditView.java From CodenameOne with GNU General Public License v2.0 | 4 votes |
public static void reLayoutEdit(boolean force) { if (mIsEditing && !isActiveTextEditorHidden() && sInstance != null && sInstance.mEditText != null) { final TextArea txt = sInstance.mEditText.mTextArea; if (!force && lastTextAreaX == txt.getAbsoluteX() + txt.getScrollX() && lastTextAreaY == txt.getAbsoluteY() + txt.getScrollY() && lastTextAreaWidth == txt.getWidth() && lastTextAreaHeight == txt.getHeight()) { return; } Display.getInstance().callSerially(new Runnable() { public void run() { if (mIsEditing && !isActiveTextEditorHidden() && sInstance != null && sInstance.mEditText != null) { if (txt != null) { if (sInstance.mEditText.mTextArea != txt) { //has changed in between, skip or would change location back to old field return; } final int txty = lastTextAreaY = txt.getAbsoluteY() + txt.getScrollY(); final int txtx = lastTextAreaX = txt.getAbsoluteX() + txt.getScrollX(); final int w = lastTextAreaWidth = txt.getWidth(); final int h = lastTextAreaHeight = txt.getHeight(); sInstance.impl.getActivity().runOnUiThread(new Runnable() { public void run() { if (mIsEditing && !isActiveTextEditorHidden() && sInstance != null && sInstance.mEditText != null) { if (sInstance.mEditText.mTextArea != txt) { //has changed in between, skip or would change location back to old field return; } sInstance.mEditLayoutParams.setMargins(txtx, txty, 0, 0); sInstance.mEditLayoutParams.width = w; sInstance.mEditLayoutParams.height = h; if (!txt.isSingleLineTextArea() && txt.getDoneListener() != null) { sInstance.mEditText.getLayoutParams().width = w; sInstance.mEditText.getLayoutParams().height = h; sInstance.mEditText.setMaxWidth(w); sInstance.mEditText.setMaxHeight(h); sInstance.setHorizontalScrollBarEnabled(false); sInstance.mEditText.setHorizontallyScrolling(false); } sInstance.mEditText.requestLayout(); sInstance.invalidate(); if (sInstance.getVisibility() != VISIBLE) { sInstance.setVisibility(VISIBLE); } sInstance.bringToFront(); } } }); } } } }); } }